Integration quickstart
Get PromptSurge running in your app in under a day.
Prerequisites
- Android API level 24+
- A PromptSurge account — sign up free
- An API key from the admin panel
1. Install the SDK
Add JitPack to your root settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Then add the SDK to your app's build.gradle.kts:
dependencies {
implementation("com.github.PromptSurge-SDK:sdk-android:0.1.0")
}Sync Gradle. No additional permissions are required in AndroidManifest.xml.
2. Initialize
Initialize once, early in your Application.onCreate():
import com.promptsurge.sdk.PromptSurge
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
PromptSurge.initialize(this, "ps_live_your_key_here")
}
}Store your API key in local.properties or BuildConfig — never commit it to source control.
3. Trigger a prompt
Call requestReview() at a natural win moment — after a user completes a level, finishes an import, or achieves a milestone:
// In an Activity (AppCompatActivity works)
PromptSurge.requestReview(this)
// Or from a Fragment
PromptSurge.requestReview(requireActivity())The SDK handles all eligibility checks automatically:
- 90-day cooldown after the pre-prompt is shown
- 7-day cooldown after a dismiss
- 10% holdout group silently skipped for measuring lift
- Server-side billing limit — when your plan's monthly impression quota is reached the native review API is called directly until the quota resets
- Falls back to a bundled English prompt if the API is unreachable
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(context)
// Re-enable if the user changes their mind
PromptSurge.optIn(context)API reference
| Method | Description |
|---|---|
| initialize(context, apiKey) | Initialize the SDK. Call once in Application.onCreate(). |
| requestReview(activity) | Show the pre-prompt if eligibility checks pass. Launches Play review on confirm. |
| optOut(context) | Permanently suppress all SDK activity for this device. |
| optIn(context) | Re-enable SDK activity (if user opts back in). |
| setLocaleOverride(locale?) | Override the device locale used to fetch prompt copy. Pass null to clear. |
| clearRateLimitForTesting() | Reset cooldown timestamps. Debug builds only. |
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 →