Skip to content

Commit c3da885

Browse files
authored
Merge pull request #1 from segment-integrations/initial_readme_changes
initial_readme_changes to main
2 parents c6b1999 + 46dab7d commit c3da885

File tree

7 files changed

+82
-98
lines changed

7 files changed

+82
-98
lines changed

README.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,48 @@
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 Flurry
2+
3+
Add Flurry support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin)
4+
5+
## Adding the dependency
6+
To install the Segment-Flurry integration, simply add this line to your gradle file:
7+
8+
```
9+
implementation 'com.segment.analytics.kotlin.destinations:flurry:<latest_version>'
10+
```
11+
Or the following for Kotlin DSL
12+
```
13+
implementation("com.segment.analytics.kotlin.destinations:flurry:<latest_version>")
14+
```
15+
16+
## Using the Plugin in your App
17+
18+
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.
19+
20+
```
21+
import com.segment.analytics.kotlin.destinations.flurry.FlurryDestination
22+
```
23+
24+
Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.
25+
26+
```
27+
analytics = Analytics("<YOUR WRITE KEY>", applicationContext) {
28+
this.flushAt = 3
29+
this.trackApplicationLifecycleEvents = true
30+
}
31+
analytics.add(plugin = FlurryDestination())
32+
```
33+
34+
Your events will now begin to flow to Flurry in device mode.
35+
36+
37+
## Integrating with Segment
38+
39+
Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details.
40+
Please see [our documentation](https://segment.com/docs/connections/destinations/catalog/flurry/) for more information.
41+
42+
43+
## Support
44+
45+
Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/).
2046

2147

2248
## License

gradle.properties

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ kotlin.code.style=official
2323
# Deployment variables
2424
GROUP=com.segment.analytics.kotlin.destinations
2525

26-
VERSION_CODE=<100>
27-
VERSION_NAME=<1.0.0>
26+
VERSION_CODE=100
27+
VERSION_NAME=1.0.0
2828

29-
POM_ARTIFACT_ID=<destination>
30-
POM_NAME=<destination>
31-
POM_DESCRIPTION=<Destination Description>
29+
POM_ARTIFACT_ID=flurry
30+
POM_NAME=flurry
31+
POM_DESCRIPTION=Destination Plugin for Flurry
3232

33-
POM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
34-
POM_SCM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
35-
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/<analytics-kotlin-destination>.git
36-
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/segmentio/<analytics-kotlin-destination>.git
33+
POM_URL=https://github.com/segmentio/analytics-kotlin-integration-flurry
34+
POM_SCM_URL=https://github.com/segmentio/analytics-kotlin-integration-flurry
35+
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-kotlin-integration-flurry.git
36+
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/segmentio/analytics-kotlin-integration-flurry.git
3737

3838
POM_LICENCE_NAME=The MIT License (MIT)
3939
POM_LICENCE_URL=http://opensource.org/licenses/MIT

lib/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.segment.analytics.kotlin.destinations">
2+
<manifest package="com.segment.analytics.kotlin.destinations.flurry">
43

54
</manifest>

lib/src/main/java/com/segment/analytics/kotlin/destinations/MyDestination.kt renamed to lib/src/main/java/com/segment/analytics/kotlin/destinations/flurry/FlurryDestination.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
package com.segment.analytics.kotlin.destinations
2-
3-
import com.segment.analytics.kotlin.core.AliasEvent
4-
import com.segment.analytics.kotlin.core.BaseEvent
5-
import com.segment.analytics.kotlin.core.GroupEvent
6-
import com.segment.analytics.kotlin.core.IdentifyEvent
7-
import com.segment.analytics.kotlin.core.ScreenEvent
8-
import com.segment.analytics.kotlin.core.Settings
9-
import com.segment.analytics.kotlin.core.TrackEvent
1+
package com.segment.analytics.kotlin.destinations.flurry
2+
3+
import com.segment.analytics.kotlin.core.*
104
import com.segment.analytics.kotlin.core.platform.DestinationPlugin
115
import com.segment.analytics.kotlin.core.platform.Plugin
126

13-
class MyDestination : DestinationPlugin() {
14-
override val key: String = TODO("Destination Name here")
7+
class FlurryDestination : DestinationPlugin() {
8+
override val key: String = "Flurry"
159

1610
override fun update(settings: Settings, type: Plugin.UpdateType) {
1711
super.update(settings, type)
1812
if (type == Plugin.UpdateType.Initial) {
19-
TODO("Setup code with $settings")
2013
}
2114
}
2215

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.segment.analytics.kotlin.destinations.flurry
2+
3+
import android.os.Bundle
4+
import io.mockk.every
5+
import io.mockk.mockk
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
import org.robolectric.RobolectricTestRunner
9+
import org.robolectric.annotation.Config
10+
11+
@RunWith(RobolectricTestRunner::class)
12+
@Config(manifest = Config.NONE)
13+
class FlurryDestinationTests {
14+
15+
@Test
16+
fun `sample mock test`() {
17+
// https://mockk.io/#dsl-examples
18+
val bundle = mockk<Bundle>()
19+
every { bundle.get("key") }.returns("value")
20+
}
21+
}

lib/src/test/kotlin/com/segment/analytics/kotlin/destinations/matchers/MyDestinationTests.kt

Lines changed: 0 additions & 55 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rootProject.name = "analytics-kotlin-destination-template"
1+
rootProject.name = "analytics-kotlin-integration-flurry"
22
include(":lib")
33
includeBuild("publishing-plugins")
44
include(":testapp")

0 commit comments

Comments
 (0)