|
1 | | -// add badges and stuff here |
2 | | - |
3 | | -# Destination |
4 | | - |
5 | | -## Getting Started |
6 | | - |
7 | | -1. Create repo from this template. The name of the repo should follow this pattern `project-language-destination`. For example `analytics-kotlin-firebase` |
8 | | -2. In `settings.gralde.kts`, change `rootProject.name` to match your repo name. |
9 | | -3. In `gradle.properties`, update the fields with `<>` brackets |
10 | | -4. Delete `com.segment.analytics.kotlin.destinations.Destination.kt` |
11 | | -5. Create a directory with the destination name under `com.segment.analytics.kotlin.destinations`. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase` |
12 | | -6. Create your destination class under the directory created in step 5. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase.Firebase.kt` |
13 | | -7. update Android manifest with your package name. For example Firebase |
14 | | - ```xml |
15 | | - <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
16 | | - package="com.segment.analytics.kotlin.destinations.firebase"> |
17 | | - ``` |
18 | | -8. Implement destination |
19 | | -9. Add tests |
| 1 | +# Analytics-Kotlin Facebook App Events |
20 | 2 |
|
| 3 | +Add Facebook App Events device mode support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin) |
| 4 | +## Adding the dependency |
| 5 | + |
| 6 | +To install the Segment-Facebook App Events integration, simply add this line to your gradle file: |
| 7 | + |
| 8 | +``` |
| 9 | +implementation 'com.segment.analytics.kotlin.destinations:facebookappevents:<latest_version>' |
| 10 | +``` |
| 11 | + |
| 12 | +Or the following for Kotlin DSL |
| 13 | + |
| 14 | +``` |
| 15 | +implementation("com.segment.analytics.kotlin.destinations:facebookappevents:<latest_version>") |
| 16 | +``` |
| 17 | + |
| 18 | +## Using the Plugin in your App |
| 19 | + |
| 20 | +Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports. |
| 21 | + |
| 22 | +``` |
| 23 | +import com.segment.analytics.kotlin.destinations.facebookappevents |
| 24 | +``` |
| 25 | + |
| 26 | +Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline. |
| 27 | + |
| 28 | +``` |
| 29 | + analytics = Analytics("<YOUR WRITE KEY>", applicationContext) { |
| 30 | + this.flushAt = 3 |
| 31 | + this.trackApplicationLifecycleEvents = true |
| 32 | + } |
| 33 | + analytics.add(plugin = FacebookAppEvents() |
| 34 | +``` |
| 35 | + |
| 36 | +Your events will now begin to flow to Facebook in device mode. |
| 37 | + |
| 38 | + |
| 39 | +## Support |
| 40 | + |
| 41 | +Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/). |
| 42 | + |
| 43 | +## Integrating with Segment |
| 44 | + |
| 45 | +Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details. |
21 | 46 |
|
22 | 47 | ## License |
23 | 48 | ``` |
|
0 commit comments