Skip to main content

Use fallbacks in iOS SDK

To use fallback paywalls and onboardings:

  1. In Xcode, use the menu File -> Add Files to "YourProjectName" to add the fallback JSON file you downloaded in the Adapty Dashboard to your project bundle.
  2. Call the .setFallback method. Place this method in your code before fetching a paywall or onboarding, ensuring that the mobile app possesses it when a fallback paywall or onboarding is required to replace the standard one.

Here's an example of retrieving fallback paywall or onboarding 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.setFallback(fileURL: urlPath)
}
} catch {
// handle the error
}

Parameters:

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