Skip to content

Wenxi/readme updates #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 7, 2022
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
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 Mixpanel

# Destination
Add Mixpanel 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-Mixpanel integration, simply add this line to your gradle file:

```
implementation 'com.segment.analytics.kotlin.destinations:mixpanel:1.4.4'
```

Or the following for Kotlin DSL

```
implementation("com.segment.analytics.kotlin.destinations:mixpanel: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.MixpanelDestination
```

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 = MixpanelDestination(applicationContext))
```

Your events will now begin to flow to Mixpanel 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-mixpanel
POM_NAME=analytics-kotlin-mixpanel
POM_ARTIFACT_ID=mixpanel
POM_NAME=mixpanel
POM_DESCRIPTION=Destination for Mixpanel

POM_URL=https://github.com/segmentio/analytics-kotlin-mixpanel
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.content.Context
import com.mixpanel.android.mpmetrics.MixpanelAPI
Expand Down