Integration quickstart
Get PromptSurge running in your Android app in under a day.
Prerequisites
- Android API level 21+
- A PromptSurge account — sign up free
- An API key from the admin panel
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:
- 90-day cooldown after the pre-prompt is shown
- 7-day cooldown after a dismiss
- Skips if the user has already submitted a review recently
- Respects Google Play's in-app review quota
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
| Method | Description |
|---|---|
| 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:
- The pre-prompt is a simple soft ask — it does not route users based on expected sentiment
- Confirming triggers the native
SKStoreReviewController(iOS) or Google'sReviewManager(Android) — never a custom rating UI - Rate limits and cooldowns are enforced client-side to respect platform quotas
- No personal data is collected beyond a hashed device ID and locale
Need help?
Email us at [email protected] or open the dashboard to manage your prompts and view metrics.
Open dashboard →