A client-side Kotlin library to integrate Knock into Android applications.
Knock is a flexible, reliable notifications infrastructure that's built to scale with you. Use our Android SDK to engage users with in-app feeds, setup push notifications, and manage notification preferences.
See the documentation for full documentation.
See the Migration Guide if upgrading from a previous version.
pluginManagement {
repositories {
..
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositories {
..
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.knocklabs:knock-android:<VERSION>'
}
// Step 1: Early initialization. Ideal place: Application().onCreate() or MainActivity.
Knock.setup(context = "applicationContext", publishableKey = "your-pk", pushChannelId = "apns-channel-id")
// Step 2: Sign in the user. Ideal timing: as soon as you have the userId.
Knock.shared.signIn(userId = "userId", userToken = "userToken")