Android Guide

Install

The Android SDK is hosted on Maven Central.

First, be sure you have Maven Central in your project-level build.gradle or settings.gradle file

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        mavenCentral()
    }
}

Then include the dependency in your module-level build.gradle file

// build.gradle.kts
dependencies {
    implementation("ai.resubscribe:resubscribe-android-sdk:1.0.10")
}

Now perform a Gradle sync to download the library.

Usage

When you would like to open up Resubscribe, call openWithConsent, replacing the placeholder values with your own values.

Resubscribe.openWithConsent(this@SomeActivity, ResubscribeOptions(
    slug = "{organization-slug}",
    apiKey = "{api-key}",
    aiType = AIType.{Intent | Churn},
    userId = "{uid}",
    userEmail = "{optionalEmail}",
))

The value of userId MUST be unique. If you do not have a unique user id at the point you want to make this call, we recommend generating a random value prefixed with 'anonymous-' for every user

Configuration

You can pass the following parameters into openWithConsent.

Last updated