Drift is the official Drift SDK for Android
- Create conversations from your app
- View past conversations from your app.
Drift uses Jitpack for its releases
Add Jitpack to your root build.gradle file
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
You can then add drift as a dependency in your app build.gradle file
dependencies {
compile 'com.github.driftt:drift-sdk-android:v1.0.7'
}
To get started with the Drift SDK you need the embed ID from your Drift settings page. This can be accessed here by looking after the drift.load method in the Javascript SDK.
In your Application onCreate
method call:
Drift.setupDrift(this, "");
Once your user has successfully logged into the app registering a user with the device is done by calling register user with a unique identifier, typically the id from your database, and their email address:
Drift.registerUser("123748", "[email protected]");
When your user logs out simply call logout so they stop receiving messages.
Drift.logout();
A user can begin a conversation in response to a campaign or by presenting the conversations list
Drift.showConversationActivity();
Thats it. Your good to go!!
Configuring the colors used within the app can be done here
To configure the accent color used in the SDK you should define a color attribute in your apps color resource file.
<color name="driftColorAccent">#157AFB</color>
Contributions are very welcome 🤘.