SuperwallOptions
A configuration class for customizing paywall appearance and behavior.
Only modify networkEnvironment if explicitly instructed by the Superwall team. Use .RELEASE (default) for production apps.
Use different SuperwallOptions configurations for debug and release builds to optimize logging, purchasing behavior, and Google Play settings for each environment.
Purpose
Configures paywall presentation, logging, Google Play purchase behavior, and other global SDK settings. Pass an instance in to Superwall.configure.
Signature
class SuperwallOptions {
var paywalls: PaywallOptions = PaywallOptions()
var shouldObservePurchases: Boolean = false
var networkEnvironment: NetworkEnvironment = NetworkEnvironment.Release()
var isExternalDataCollectionEnabled: Boolean = true
var localeIdentifier: String? = null
var isGameControllerEnabled: Boolean = false
var passIdentifiersToPlayStore: Boolean = false
var enableExperimentalDeviceVariables: Boolean = false
var logging: Logging = Logging()
var useMockReviews: Boolean = false
}// Java
public class SuperwallOptions {
public PaywallOptions paywalls = new PaywallOptions();
public boolean shouldObservePurchases = false;
public NetworkEnvironment networkEnvironment = new NetworkEnvironment.Release();
public boolean isExternalDataCollectionEnabled = true;
public @Nullable String localeIdentifier = null;
public boolean isGameControllerEnabled = false;
public boolean passIdentifiersToPlayStore = false;
public boolean enableExperimentalDeviceVariables = false;
public Logging logging = new Logging();
public boolean useMockReviews = false;
}Parameters
| Property | Type | Description |
|---|---|---|
paywalls | PaywallOptions | Controls paywall presentation, preload, and alert behavior. |
shouldObservePurchases | Boolean | Set to true to have Superwall observe Google Play purchases you make outside the SDK. |
networkEnvironment | NetworkEnvironment | Overrides the API environment. Only change if instructed by Superwall. |
isExternalDataCollectionEnabled | Boolean | Allows Superwall to send non-paywall analytics events to the backend. Defaults to true. |
localeIdentifier | String? | Overrides the locale used for rule evaluation (e.g., "en_GB"). |
isGameControllerEnabled | Boolean | Forwards game controller events to paywalls. |
passIdentifiersToPlayStore | Boolean | When true, Google Play receives the raw userId as obfuscatedExternalAccountId; otherwise Superwall sends a SHA-256 hash. |
enableExperimentalDeviceVariables | Boolean | Enables experimental device variables (subject to change). |
logging | Logging | Sets log level and scopes printed to Logcat. |
useMockReviews | Boolean | Shows mock Google Play review dialogs for testing. |
How passIdentifiersToPlayStore affects Google Play
Superwall always calls BillingFlowParams.Builder.setObfuscatedAccountId(Superwall.instance.externalAccountId) when launching a billing flow.
- Default (
false) –externalAccountIdis a SHA-256 hash of theuserId. Google Play displays the hashed value asobfuscatedExternalAccountId, and the same hash is sent back to your servers. - Enabled (
true) – Superwall forwards the exactappUserIdyou passed toidentify(). This makes it easier to correlate Google Play purchases with your users, but the value must comply with Google's policy and must not contain PII.
Configure it as part of your application startup:
val options = SuperwallOptions().apply {
passIdentifiersToPlayStore = true
logging.level = LogLevel.info
}
Superwall.configure(
application = this,
apiKey = "pk_your_api_key",
options = options
)Related
How is this guide?
Edit on GitHub