Skip to main content

Flutter - Use fallback paywalls

To use fallback paywalls, call the .setFallbackPaywalls method. Pass the path to the fallback JSON file you downloaded in the Adapty Dashboard. Place this method in your code before fetching a paywall, ensuring that the mobile app possesses it when a fallback paywall is required to replace the standard one.

javascript
import 'dart:async' show Future;
import 'dart:io' show Platform;

final assetId = Platform.isIOS ? 'assets/ios_fallback.json' : 'assets/android_fallback.json';

try {
await adapty.setFallbackPaywalls(assetId);
} on AdaptyError catch (adaptyError) {
// handle the error
} catch (e) {
}

Parameters:

ParameterDescription
assetIdThe path to the fallback JSON file you downloaded in the Adapty Dashboard.