Skip to main content

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