SuperwallOptions
A configuration class for customizing paywalls, the Customer Center, and other SDK 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 customerCenter: CustomerCenterConfiguration = CustomerCenterConfiguration.default
var shouldObservePurchases: Boolean = false
var networkEnvironment: NetworkEnvironment = NetworkEnvironment.Release()
var adConsent: AdConsent = AdConsent.Unspecified
var eventTrackingBehavior: EventTrackingBehavior = EventTrackingBehavior.ALL
@Deprecated("Use eventTrackingBehavior instead.")
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
var testModeBehavior: TestModeBehavior = TestModeBehavior.AUTOMATIC
}// Java
public class SuperwallOptions {
public PaywallOptions paywalls = new PaywallOptions();
public CustomerCenterConfiguration getCustomerCenter();
public void setCustomerCenter(CustomerCenterConfiguration value);
public boolean shouldObservePurchases = false;
public NetworkEnvironment networkEnvironment = new NetworkEnvironment.Release();
public AdConsent getAdConsent();
public void setAdConsent(AdConsent value);
public EventTrackingBehavior eventTrackingBehavior = EventTrackingBehavior.ALL;
@Deprecated
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;
public TestModeBehavior testModeBehavior = TestModeBehavior.AUTOMATIC;
}Parameters
Prop
Type
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
Ad measurement consent (2.9.0+)
Set the initial consent before configuring the SDK:
import com.superwall.sdk.config.options.AdConsent
import com.superwall.sdk.config.options.AdConsentStatus
import com.superwall.sdk.config.options.SuperwallOptions
val options = SuperwallOptions().apply {
adConsent = AdConsent.Custom(
adUserData = AdConsentStatus.Denied,
adPersonalization = AdConsentStatus.Denied
)
}
Superwall.configure(application = this, apiKey = "pk_your_api_key", options = options)AdConsent.Unspecified is the default. When GDPR applies, it uses consent stored by an IAB TCF consent banner; otherwise both signals default to Granted. If your app has users in the EEA, UK, or Switzerland and does not use a TCF banner, set AdConsent.Custom from your consent flow. Explicit Custom values take precedence over the banner. Both fields in Custom default to AdConsentStatus.Granted, so pass each user's choice explicitly.
Prop
Type
Update consent after configuration with Superwall.instance.adConsent. The SDK reports adUserDataConsent and adPersonalizationConsent as device attributes and forwards them with conversions uploaded to Google Ads and Meta. adConsentSource identifies the source as developer, tcf, or default. Both signals are reported as denied while eventTrackingBehavior is NONE.
Custom network environments (2.9.0+)
Only configure a custom environment when instructed by the Superwall team. SuperwallOptions.NetworkEnvironment.Custom accepts baseHost, collectorHost, scheme, and nullable port, plus optional subscriptionHost, enrichmentHost, and mmpHost. The optional hosts default to subscriptions-api.superwall.dev, enrichment-api.superwall.dev, and mmp.superwall.dev respectively. Production apps should keep NetworkEnvironment.Release().
Billing logs (2.10.0+)
Use LogScope.billing in SuperwallOptions.logging.scopes to enable Google Play Billing logs:
import com.superwall.sdk.config.options.SuperwallOptions
import com.superwall.sdk.logger.LogScope
import java.util.EnumSet
val options = SuperwallOptions().apply {
logging.scopes = EnumSet.of(LogScope.billing)
}LogScope.storeKitManager is deprecated but still enables billing logs. A SuperwallDelegate.handleLog implementation that filters the scope string must now match "billing".
How is this guide?