SuperwallOptions
Configuration options for customizing Superwall SDK behavior.
Purpose
Configures various aspects of the Superwall SDK including paywall behavior, logging, and network settings.
Signature
class SuperwallOptions {
PaywallOptions paywalls = PaywallOptions();
NetworkEnvironment networkEnvironment = NetworkEnvironment.release;
bool isExternalDataCollectionEnabled = true;
String? localeIdentifier;
bool isGameControllerEnabled = false;
Logging logging = Logging();
bool passIdentifiersToPlayStore = false;
}Parameters
Prop
Type
Android-only: passIdentifiersToPlayStore
Flutter apps can target both iOS and Android. Google Play always consumes the identifier you send through BillingFlowParams.Builder.setObfuscatedAccountId, which the SDK sources from Superwall.instance.externalAccountId.
- When
passIdentifiersToPlayStoreisfalse(default) we SHA-256 hash youruserIdbefore sending it. Play Console and the Superwall backend will show the hashed value. - When it is
true, we pass the exactappUserIdyou supplied toSuperwall.shared.identify. This only changes behavior on Android—the flag is ignored on iOS builds.
Set the option at configuration time when you specifically need the un-hashed identifier:
final options = SuperwallOptions()
..passIdentifiersToPlayStore = true;
await Superwall.configure(
apiKey,
options: options,
);Make sure the identifier complies with Google's policy and never contains personally identifiable information.
Usage
Basic options:
final options = SuperwallOptions()
..paywalls = PaywallOptions()
..logging = (Logging()..level = LogLevel.debug);
await Superwall.configure(
'pk_your_api_key',
options: options,
);Production configuration:
final productionOptions = SuperwallOptions()
..paywalls = (PaywallOptions()
..shouldPreload = true
..automaticallyDismiss = true)
..networkEnvironment = NetworkEnvironment.release
..isExternalDataCollectionEnabled = true
..logging = (Logging()..level = LogLevel.warn);Development configuration (with Play Store IDs on Android):
final developmentOptions = SuperwallOptions()
..paywalls = (PaywallOptions()
..shouldPreload = false
..automaticallyDismiss = false)
..networkEnvironment = NetworkEnvironment.developer
..logging = (Logging()
..level = LogLevel.debug
..scopes = {LogScope.all})
..passIdentifiersToPlayStore = true; // Android onlyCustom locale:
final localizedOptions = SuperwallOptions()
..localeIdentifier = 'es_ES' // Spanish (Spain)
..paywalls = (PaywallOptions()..shouldPreload = true);Related
How is this guide?
Edit on GitHub