Skip to content
PreviewNot live yet. APIs and SDKs on these pages may change before launch.

Android

Prerequisites: Android 7.0+ (API 24), Firebase in your app, an app in Settings → Apps with an Android client key, and an FCM service account. Read Concepts.

  1. Add the dependencies.

    app/build.gradle.kts
    implementation("com.mailpidge:lifecycle-sdk-core:1.0.0")
    implementation("com.mailpidge:lifecycle-sdk-notifications:1.0.0")
  2. Link a Google Cloud project to your app in Play Console and note its project number (without it: 403 attestation_required).

  3. Configure in your Application.

    MailPidgeLifecycle.configure(
    context = this,
    clientCredential = "mpck_…",
    appId = "pidgefit-android",
    workerBaseUrl = "https://api.mailpidge.com",
    playIntegrityCloudProjectNumber = 123456789012L,
    )
  4. Register the FCM token. On Android 13+, request POST_NOTIFICATIONS first.

    override fun onNewToken(token: String) {
    CoroutineScope(Dispatchers.IO).launch { MailPidgeLifecycle.registerPushToken(token) }
    }
  5. Identify after sign-in; reset on sign-out.

    MailPidgeLifecycle.identify(externalUserId = user.id, identityToken = identityToken)
    MailPidgeLifecycle.reset()
  6. Track events and record consent.

    MailPidgeLifecycle.track("workout_completed", mapOf("minutes" to 42))

Settings → Apps → your app → Send test push. The device shows as Active.