Android SDK
Add Jake Messenger to Kotlin and Java apps
Android SDK
TL;DR: Add the dependency. Configure once. Authenticate from your backend. Call
Jake.present(activity). API 23+.
1. Install
dependencies {
implementation("ai.tryjake:jake-android:0.1.0")
}Before the first Maven release, use local substitution with the jake-android repo.
2. Configure
import ai.tryjake.sdk.Jake
Jake.configure(
context = applicationContext,
workspaceId = "workspace_123",
publicKey = "pk_live_123",
)3. Authenticate
Your backend creates the token:
lifecycleScope.launch {
val response = api.createJakeUserToken()
Jake.authenticate(userId = response.userId, token = response.token)
}Session protected by Android Keystore.
4. Present
supportButton.setOnClickListener {
Jake.present(this)
}5. Logout
Jake.logout() // always before authenticating a different userUnread and errors
Jake.listener = object : JakeListener {
override fun onUnreadCountChanged(count: Int) { /* badge */ }
override fun onAuthenticationExpired() { /* refresh token */ }
override fun onError(error: JakeException) { /* log */ }
}Events and attributes
Jake.track("subscription_upgraded", properties = mapOf("plan" to JakeValue.string("pro")))
Jake.setUserAttributes(mapOf("company" to JakeValue.string("Acme")))Push (FCM)
FirebaseMessaging.getInstance().token.addOnSuccessListener { token ->
Jake.setPushToken(token)
}Troubleshooting
- Retry state — check network, workspace values, auth, and System WebView version
- Auth expires — SDK dismisses and calls
onAuthenticationExpired
Next: Go-live checklist →
