PromptSurge
Get started

Integration quickstart

Get PromptSurge running in your Android app in under a day.

Prerequisites

1. Install the SDK

Add the dependency to your app's build.gradle:

dependencies {
    implementation 'me.promptsurge:sdk-android:1.0.0'
}

Or with Kotlin DSL (build.gradle.kts):

dependencies {
    implementation("me.promptsurge:sdk-android:1.0.0")
}

Sync Gradle. No additional permissions are required in AndroidManifest.xml.

2. Initialize

Initialize once, early in your Application.onCreate():

import me.promptsurge.sdk.PromptSurge

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        PromptSurge.initialize(
            context = this,
            apiKey = "ps_live_your_key_here",
            // Optional: override the API endpoint (default: https://api.promptsurge.me)
            // apiUrl = "https://api.promptsurge.me"
        )
    }
}

Store your API key in local.properties or use BuildConfig — never commit it to source control.

3. Trigger a prompt

Call showPrePromptIfEligible() at a natural win moment — after a user completes a level, finishes an import, or achieves a milestone:

// In an Activity or Fragment
PromptSurge.showPrePromptIfEligible(activity = this)

// Or from a ViewModel (pass the Activity reference)
PromptSurge.showPrePromptIfEligible(activity = requireActivity())

The SDK handles all eligibility checks automatically:

4. Opt-out support

Expose an opt-out option in your privacy settings:

// Opt the user out — persists across restarts, stops all SDK activity
PromptSurge.optOut()

// Check current status
val isOptedOut = PromptSurge.isOptedOut()

// Re-enable (if user changes their mind)
PromptSurge.optIn()

API reference

MethodDescription
initialize(context, apiKey)Initialize the SDK. Call once in Application.onCreate().
showPrePromptIfEligible(activity)Show the pre-prompt if eligibility checks pass.
optOut()Permanently suppress all SDK activity for this device.
optIn()Re-enable SDK activity (if user opts back in).
isOptedOut()Returns true if the user has opted out.

Apple / Google compliance

PromptSurge is designed from the ground up to comply with both Apple App Store Review Guideline 5.6.1 and Google Play's in-app review policy:


Need help?

Email us at [email protected] or open the dashboard to manage your prompts and view metrics.

Open dashboard →