Bubbl must be initialized once at app startup.
File: app/src/main/java/.../MyApplication.kt
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Initialize Firebase first
if (FirebaseApp.getApps(this).isEmpty()) {
FirebaseApp.initializeApp(this)
}
// Initialize Bubbl
BubblSdk.init(
application = this,
config = BubblConfig(
apiKey = "YOUR_API_KEY",
environment = Environment.PRODUCTION,
segmentationTags = emptyList(),
geoPollInterval = 5 * 60_000L,
defaultDistance = 10
)
)
}
}- Firebase must be ready before the SDK registers for notifications.
- Bubbl needs an
Applicationcontext because it lives across activities.
TenantConfigStore.load(this)?.let { cfg ->
BubblSdk.init(
application = this,
config = TenantConfigStore.toBubblConfig(cfg)
)
}Tooltip
If you have a fixed API key, you can hardcode it and skip TenantConfigStore entirely.