Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 45 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
// add badges and stuff here

# Destination

## Getting Started

1. Create repo from this template. The name of the repo should follow this pattern `project-language-destination`. For example `analytics-kotlin-firebase`
2. In `settings.gralde.kts`, change `rootProject.name` to match your repo name.
3. In `gradle.properties`, update the fields with `<>` brackets
4. Delete `com.segment.analytics.kotlin.destinations.Destination.kt`
5. Create a directory with the destination name under `com.segment.analytics.kotlin.destinations`. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase`
6. Create your destination class under the directory created in step 5. For example Firebase, `com.segment.analytics.kotlin.destinations.firebase.Firebase.kt`
7. update Android manifest with your package name. For example Firebase
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.segment.analytics.kotlin.destinations.firebase">
```
8. Implement destination
9. Add tests
# Analytics-Kotlin Flurry

Add Flurry support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin)

## Adding the dependency
To install the Segment-Flurry integration, simply add this line to your gradle file:

```
implementation 'com.segment.analytics.kotlin.destinations:flurry:<latest_version>'
```
Or the following for Kotlin DSL
```
implementation("com.segment.analytics.kotlin.destinations:flurry:<latest_version>")
```

## Using the Plugin in your App

Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.

```
import com.segment.analytics.kotlin.destinations.flurry.FlurryDestination
```

Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.

```
analytics = Analytics("<YOUR WRITE KEY>", applicationContext) {
this.flushAt = 3
this.trackApplicationLifecycleEvents = true
}
analytics.add(plugin = FlurryDestination())
```

Your events will now begin to flow to Flurry in device mode.


## Integrating with Segment

Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details.
Please see [our documentation](https://segment.com/docs/connections/destinations/catalog/flurry/) for more information.


## Support

Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/).


## License
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ kotlin.code.style=official
# Deployment variables
GROUP=com.segment.analytics.kotlin.destinations

VERSION_CODE=<100>
VERSION_NAME=<1.0.0>
VERSION_CODE=100
VERSION_NAME=1.0.0

POM_ARTIFACT_ID=<destination>
POM_NAME=<destination>
POM_DESCRIPTION=<Destination Description>
POM_ARTIFACT_ID=flurry
POM_NAME=flurry
POM_DESCRIPTION=Destination Plugin for Flurry

POM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
POM_SCM_URL=https://github.com/segmentio/<analytics-kotlin-destination>
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/<analytics-kotlin-destination>.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/<analytics-kotlin-destination>.git
POM_URL=https://github.com/segmentio/analytics-kotlin-integration-flurry
POM_SCM_URL=https://github.com/segmentio/analytics-kotlin-integration-flurry
POM_SCM_CONNECTION=scm:git:git://github.com/segmentio/analytics-kotlin-integration-flurry.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segmentio/analytics-kotlin-integration-flurry.git

POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
Expand Down
3 changes: 1 addition & 2 deletions lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.segment.analytics.kotlin.destinations">
<manifest package="com.segment.analytics.kotlin.destinations.flurry">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
package com.segment.analytics.kotlin.destinations

import com.segment.analytics.kotlin.core.AliasEvent
import com.segment.analytics.kotlin.core.BaseEvent
import com.segment.analytics.kotlin.core.GroupEvent
import com.segment.analytics.kotlin.core.IdentifyEvent
import com.segment.analytics.kotlin.core.ScreenEvent
import com.segment.analytics.kotlin.core.Settings
import com.segment.analytics.kotlin.core.TrackEvent
package com.segment.analytics.kotlin.destinations.flurry

import com.segment.analytics.kotlin.core.*
import com.segment.analytics.kotlin.core.platform.DestinationPlugin
import com.segment.analytics.kotlin.core.platform.Plugin

class MyDestination : DestinationPlugin() {
override val key: String = TODO("Destination Name here")
class FlurryDestination : DestinationPlugin() {
override val key: String = "Flurry"

override fun update(settings: Settings, type: Plugin.UpdateType) {
super.update(settings, type)
if (type == Plugin.UpdateType.Initial) {
TODO("Setup code with $settings")
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.segment.analytics.kotlin.destinations.flurry

import android.os.Bundle
import io.mockk.every
import io.mockk.mockk
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@RunWith(RobolectricTestRunner::class)
@Config(manifest = Config.NONE)
class FlurryDestinationTests {

@Test
fun `sample mock test`() {
// https://mockk.io/#dsl-examples
val bundle = mockk<Bundle>()
every { bundle.get("key") }.returns("value")
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "analytics-kotlin-destination-template"
rootProject.name = "analytics-kotlin-integration-flurry"
include(":lib")
includeBuild("publishing-plugins")
include(":testapp")