Mobile SDK quickstart
This guide gets one application installation connected to Engage. Before starting, create the platform app in the console and copy its public eng_app_… app key.
Install and start
Add JitPack in settings.gradle.kts, then the modules you need:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://jitpack.io") {
content { includeGroup("com.github.mathias8dev.engage-android") }
}
}
}dependencies {
implementation("com.github.mathias8dev.engage-android:engage-android-core:2.1.1")
implementation("com.github.mathias8dev.engage-android:engage-android-push-fcm:2.1.1")
implementation("com.github.mathias8dev.engage-android:engage-android-in-app:2.1.1")
}Start Engage from Application.onCreate:
class ExampleApplication : Application() {
override fun onCreate() {
super.onCreate()
Engage.start(
context = this,
config = EngageConfig(
appKey = BuildConfig.ENGAGE_APP_KEY,
logLevel = if (BuildConfig.DEBUG) EngageLogLevel.DEBUG else EngageLogLevel.INFO,
),
)
}
}Declare .ExampleApplication in the manifest. See the complete Android integration.
Verify
Observe the installation ID and check the same ID in the Engage console.
Engage.installation.id.collect { installationId ->
Log.d("Example", "Engage installation: $installationId")
}The ID may be absent until bootstrap succeeds. Do not generate or persist a replacement yourself.
Next steps
- Configure push and request notification permission in the host app.
- Track an event to populate analytics and audience data.
- Bind the installation after the user signs in.
- Add in-app placements or Message Center.