Gradle dependency
dependencies {
implementation("app.supportal:sdk:0.1.0")
}Publish locally with ./gradlew :sdk:publishToMavenLocal from sdks/android. The host app needs the Compose compiler plugin when using SupportalChat() or SupportalHelpCenter().
Initialize
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Supportal.init(this, SupportalConfig(
host = "https://support.clientname.app",
identityTokenProvider = { myBackend.identityToken() },
primaryColor = Color(0xFF2D6E50),
))
setContent { SupportalChat() }
}
}Non-Compose apps
Supportal.init(context, SupportalConfig(host = "https://support.clientname.app"))
Supportal.open(context) // launches SupportalActivitySession & identity
Supportal.identify { token } replaces the provider and exchanges a new session. Supportal.logout() clears the encrypted session token and rotates the anonymous id. The provider must not call back into Supportal during token fetch.
Channel
Sessions are created with channel: "android" alongside identityToken (optional) and a persisted anonymousId UUID.