Skip to content
Last updated

Quick Start (Minimal Steps)

This is the fast path. It skips deep explanations. Use the full guide for context and troubleshooting.

Step 1: Add the SDK and FirebaseAdd to app/build.gradle.kts.

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    id("com.google.gms.google-services")
}

dependencies {
    implementation(platform("com.google.firebase:firebase-bom:33.3.0"))
    implementation("com.google.firebase:firebase-messaging-ktx")

    implementation("tech.bubbl:bubbl-sdk:2.0.9")

    implementation("com.google.android.gms:play-services-location:21.2.0")
    implementation("androidx.work:work-runtime-ktx:2.10.0")
}

Step 2: Add permissions and servicesAdd to app/src/main/AndroidManifest.xml.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:name=".MyApplication"
    ...>

    <service
        android:name="tech.bubbl.sdk.services.LocationUpdatesService"
        android:foregroundServiceType="location" />

    <service
        android:name="tech.bubbl.sdk.services.MyFirebaseMessagingService"
        android:exported="false">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="bubbl_push" />
</application>

Step 3: Initialize in Application

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        if (FirebaseApp.getApps(this).isEmpty()) {
            FirebaseApp.initializeApp(this)
        }

        BubblSdk.init(
            application = this,
            config = BubblConfig(
                apiKey = "YOUR_API_KEY",
                environment = Environment.PRODUCTION,
                segmentationTags = emptyList(),
                geoPollInterval = 5 * 60_000L,
                defaultDistance = 10
            )
        )
    }
}

Step 4: Request permissions and start tracking

if (PermissionManager(this).locationGranted()) {
    BubblSdk.startLocationTracking(this)
}
override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
    intent.getStringExtra("payload")?.let { json ->
        val notif = Gson().fromJson(json, NotificationRouter.DomainNotification::class.java)
        ModalFragment.newInstance(notif).show(supportFragmentManager, "notification_modal")
    }
}

That is enough to start. Use the full guide for a complete, production‑ready setup.