Skip to main content

iOS - Use fallback paywalls

To use fallback paywalls:

  1. Place the fallback JSON file you downloaded in the Adapty Dashboard alongside your app in the user's device.
  2. Call the .setFallbackPaywalls method. 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.

Here's an example of retrieving fallback paywall data from a locally stored JSON file named ios_fallback.json.

do {
if let urlPath = Bundle.main.url(forResource: fileName, withExtension: "json") {
try await Adapty.setFallbackPaywalls(fileURL: urlPath)
}
} catch {
// handle the error
}

Parameters:

ParameterDescription
fileURLPath to the file with fallback paywalls you downloaded in the Adapty Dashboard.