Skip to content

Commit

Permalink
Merge pull request #1 from segment-integrations/wenxi/readme-udpates
Browse files Browse the repository at this point in the history
readme updates
  • Loading branch information
wenxi-zeng authored Mar 7, 2022
2 parents 87f6acb + 945d8f1 commit 74a1a07
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:

cancel_previous:

permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: styfle/[email protected]
Expand Down
48 changes: 44 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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("<YOUR WRITE KEY>", 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
```
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
}
}
2 changes: 1 addition & 1 deletion lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.segment.analytics.destinations.plugins">
package="com.segment.analytics.kotlin.destinations.plugins">

</manifest>
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 74a1a07

Please sign in to comment.