Android SDK Quickstart
Native Kotlin SDK for Android apps using FCM.
Installation
Add the dependency to your app's build.gradle:
dependencies {
implementation 'io.hober:sdk:1.0.0'
}
Initialize
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Hober.init(
context = AppContextImpl(this),
sdkKey = "YOUR_SDK_KEY",
channelId = "default"
)
}
}
Request Permission (Android 13+)
Hober.requestPermission(activity = AndroidActivityHost(this)) { granted ->
if (granted) {
// Permission granted — register device
}
}
Identify Subscriber
Hober.identifySubscriber(externalId = "user-123", email = "user@example.com") { result ->
when (result) {
is SubscriberResult.Success -> { /* proceed */ }
is SubscriberResult.Error -> { /* handle error */ }
}
}
Extend HoberFirebaseMessagingService
class MyFirebaseService : HoberFirebaseMessagingService()
Register it in your AndroidManifest.xml:
<service android:name=".MyFirebaseService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Next Steps
- Android SDK Guide — FCM setup, notification customization, and advanced configuration
- Android SDK API Reference — full Dokka-generated KDoc method signatures and type definitions
- Hober REST API Reference — direct REST API access