diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00d7530..b0e06e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: cancel_previous: - + permissions: write-all runs-on: ubuntu-latest steps: - uses: styfle/cancel-workflow-action@0.9.1 diff --git a/README.md b/README.md index 9a0001a..57625f7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,51 @@ -// add badges and stuff here +# Analytics-Kotlin Appsflyer -# Destination +Add Appsflyer device mode support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin) -## Getting Started +## Adding the dependency -// TODO +To install the Segment-Appsflyer integration, simply add this line to your gradle file: +``` +implementation 'com.segment.analytics.kotlin.destinations:appsflyer:1.4.4' +``` + +Or the following for Kotlin DSL + +``` +implementation("com.segment.analytics.kotlin.destinations:appsflyer:1.4.4") +``` + + + +## 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.plugins.AppsflyerDestination +``` + +Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline. + +``` + analytics = Analytics("", applicationContext) { + this.flushAt = 3 + this.trackApplicationLifecycleEvents = true + } + analytics.add(plugin = AppsflyerDestination(applicationContext)) +``` + +Your events will now begin to flow to Appsflyer in device mode. + + +## Support + +Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/). + +## Integrating with Segment + +Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details. ## License ``` diff --git a/gradle.properties b/gradle.properties index 245ff28..9978a3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,13 +21,13 @@ android.enableJetifier=true kotlin.code.style=official # Deployment variables -GROUP=com.segment.analytics.kotlin +GROUP=com.segment.analytics.kotlin.destinations -VERSION_CODE=100 -VERSION_NAME=1.0.0 +VERSION_CODE=144 +VERSION_NAME=1.4.4 -POM_ARTIFACT_ID=analytics-kotlin-appsflyer -POM_NAME=analytics-kotlin-appsflyer +POM_ARTIFACT_ID=appsflyer +POM_NAME=appsflyer POM_DESCRIPTION=Destination for Appsflyer POM_URL=https://github.com/segmentio/analytics-kotlin-appsflyer diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 7c50dd0..11710b6 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -12,15 +12,16 @@ android { defaultConfig { multiDexEnabled = true - minSdk = 21 + minSdk = 16 targetSdk = 31 testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + consumerProguardFiles("proguard-consumer-rules.pro") } buildTypes { release { - isMinifyEnabled = true + isMinifyEnabled = false proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } diff --git a/lib/src/androidTest/java/com/segment/analytics/destinations/plugins/ExampleInstrumentedTest.kt b/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt similarity index 77% rename from lib/src/androidTest/java/com/segment/analytics/destinations/plugins/ExampleInstrumentedTest.kt rename to lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt index e6a2589..3686f35 100644 --- a/lib/src/androidTest/java/com/segment/analytics/destinations/plugins/ExampleInstrumentedTest.kt +++ b/lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.segment.analytics.destinations.plugins +package com.segment.analytics.kotlin.destinations.plugins import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry @@ -19,6 +19,6 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.segment.analytics.destinations.plugins.test", appContext.packageName) + assertEquals("com.segment.analytics.kotlin.destinations.plugins.test", appContext.packageName) } } \ No newline at end of file diff --git a/lib/src/main/AndroidManifest.xml b/lib/src/main/AndroidManifest.xml index 2c569f8..e5f5b96 100644 --- a/lib/src/main/AndroidManifest.xml +++ b/lib/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.segment.analytics.kotlin.destinations.plugins"> \ No newline at end of file diff --git a/lib/src/main/java/com/segment/analytics/destinations/plugins/AppsflyerDestination.kt b/lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt similarity index 99% rename from lib/src/main/java/com/segment/analytics/destinations/plugins/AppsflyerDestination.kt rename to lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt index d62b073..f25ad29 100644 --- a/lib/src/main/java/com/segment/analytics/destinations/plugins/AppsflyerDestination.kt +++ b/lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestination.kt @@ -1,4 +1,4 @@ -package com.segment.analytics.destinations.plugins +package com.segment.analytics.kotlin.destinations.plugins import android.app.Activity import android.content.Context diff --git a/lib/src/test/java/com/segment/analytics/destinations/plugins/AppsflyerDestinationTests.kt b/lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt similarity index 98% rename from lib/src/test/java/com/segment/analytics/destinations/plugins/AppsflyerDestinationTests.kt rename to lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt index a60f489..c7155df 100644 --- a/lib/src/test/java/com/segment/analytics/destinations/plugins/AppsflyerDestinationTests.kt +++ b/lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/AppsflyerDestinationTests.kt @@ -1,4 +1,4 @@ -package com.segment.analytics.destinations.plugins +package com.segment.analytics.kotlin.destinations.plugins import android.app.Activity import android.content.Context @@ -7,13 +7,10 @@ import androidx.core.os.bundleOf import com.appsflyer.AppsFlyerLib import com.segment.analytics.kotlin.core.* import com.segment.analytics.kotlin.core.platform.Plugin -import com.segment.analytics.kotlin.core.platform.plugins.logger.* import io.mockk.Called import io.mockk.MockKAnnotations -import io.mockk.Runs import io.mockk.every import io.mockk.impl.annotations.MockK -import io.mockk.just import io.mockk.mockk import io.mockk.mockkStatic import io.mockk.verify