Skip to content

Commit 376adac

Browse files
authored
Merge pull request #1 from segment-integrations/wenxi/readme-updates
Wenxi/readme updates
2 parents 5a1b847 + 33f9b9d commit 376adac

File tree

8 files changed

+58
-17
lines changed

8 files changed

+58
-17
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111

1212
cancel_previous:
13-
13+
permissions: write-all
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: styfle/[email protected]

README.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,51 @@
1-
// add badges and stuff here
1+
# Analytics-Kotlin Mixpanel
22

3-
# Destination
3+
Add Mixpanel device mode support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin)
44

5-
## Getting Started
5+
## Adding the dependency
66

7-
// TODO
7+
To install the Segment-Mixpanel integration, simply add this line to your gradle file:
88

9+
```
10+
implementation 'com.segment.analytics.kotlin.destinations:mixpanel:1.4.4'
11+
```
12+
13+
Or the following for Kotlin DSL
14+
15+
```
16+
implementation("com.segment.analytics.kotlin.destinations:mixpanel:1.4.4")
17+
```
18+
19+
20+
21+
## Using the Plugin in your App
22+
23+
Open the file where you setup and configure the Analytics-Kotlin library. Add this plugin to the list of imports.
24+
25+
```
26+
import com.segment.analytics.kotlin.destinations.plugins.MixpanelDestination
27+
```
28+
29+
Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.
30+
31+
```
32+
analytics = Analytics("<YOUR WRITE KEY>", applicationContext) {
33+
this.flushAt = 3
34+
this.trackApplicationLifecycleEvents = true
35+
}
36+
analytics.add(plugin = MixpanelDestination(applicationContext))
37+
```
38+
39+
Your events will now begin to flow to Mixpanel in device mode.
40+
41+
42+
## Support
43+
44+
Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/).
45+
46+
## Integrating with Segment
47+
48+
Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details.
949

1050
## License
1151
```

gradle.properties

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ android.enableJetifier=true
2121
kotlin.code.style=official
2222

2323
# Deployment variables
24-
GROUP=com.segment.analytics.kotlin
24+
GROUP=com.segment.analytics.kotlin.destinations
2525

26-
VERSION_CODE=100
27-
VERSION_NAME=1.0.0
26+
VERSION_CODE=144
27+
VERSION_NAME=1.4.4
2828

29-
POM_ARTIFACT_ID=analytics-kotlin-mixpanel
30-
POM_NAME=analytics-kotlin-mixpanel
29+
POM_ARTIFACT_ID=mixpanel
30+
POM_NAME=mixpanel
3131
POM_DESCRIPTION=Destination for Mixpanel
3232

3333
POM_URL=https://github.com/segmentio/analytics-kotlin-mixpanel

lib/build.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ android {
1212

1313
defaultConfig {
1414
multiDexEnabled = true
15-
minSdk = 21
15+
minSdk = 16
1616
targetSdk = 31
1717

1818
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
19+
consumerProguardFiles("proguard-consumer-rules.pro")
1920
}
2021

2122
buildTypes {
2223
release {
23-
isMinifyEnabled = true
24+
isMinifyEnabled = false
2425
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
2526
}
2627
}

lib/src/androidTest/java/com/segment/analytics/destinations/plugins/ExampleInstrumentedTest.kt renamed to lib/src/androidTest/java/com/segment/analytics/kotlin/destinations/plugins/ExampleInstrumentedTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.segment.analytics.destinations.plugins
1+
package com.segment.analytics.kotlin.destinations.plugins
22

33
import androidx.test.ext.junit.runners.AndroidJUnit4
44
import androidx.test.platform.app.InstrumentationRegistry
@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
1919
fun useAppContext() {
2020
// Context of the app under test.
2121
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22-
assertEquals("com.segment.analytics.destinations.plugins.test", appContext.packageName)
22+
assertEquals("com.segment.analytics.kotlin.destinations.plugins.test", appContext.packageName)
2323
}
2424
}

lib/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.segment.analytics.destinations.plugins">
3+
package="com.segment.analytics.kotlin.destinations.plugins">
44

55
</manifest>

lib/src/main/java/com/segment/analytics/destinations/plugins/MixpanelDestination.kt renamed to lib/src/main/java/com/segment/analytics/kotlin/destinations/plugins/MixpanelDestination.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.segment.analytics.destinations.plugins
1+
package com.segment.analytics.kotlin.destinations.plugins
22

33
import android.app.Activity
44
import android.content.Context

lib/src/test/java/com/segment/analytics/destinations/plugins/MixpanelDestinationTests.kt renamed to lib/src/test/java/com/segment/analytics/kotlin/destinations/plugins/MixpanelDestinationTests.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.segment.analytics.destinations.plugins
1+
package com.segment.analytics.kotlin.destinations.plugins
22

33
import android.content.Context
44
import com.mixpanel.android.mpmetrics.MixpanelAPI

0 commit comments

Comments
 (0)