Après l'installation, exécutez la skill dans votre projet :
/adapty-sdk-integration
Les paywalls de secours sont pris en charge par le SDK Android v2.11 et versions ultérieures.
To maintain a fluid user experience, it is important to set up fallbacks for your flows, paywalls, and onboardings. This precaution extends the application’s capabilities in case of partial or complete loss of internet connection.
If the application cannot access Adapty servers:
It will be able to display a fallback flow or paywall, and access the local onboarding configuration.
If the application cannot access the internet:
It will be able to display a fallback flow or paywall. Onboardings include remote content and require an internet connection to function.
Before you follow the steps in this guide, download the fallback configuration files from Adapty.
Configuration
Déplacez le fichier de configuration de secours dans le répertoire assets ou res/raw de votre projet Android.
Appelez la méthode .setFallbackavant de récupérer le flow, le paywall ou l’onboarding cible.
//if you put the 'android_fallback.json' file to the 'assets' directoryval location = FileLocation.fromAsset("android_fallback.json")//or `FileLocation.fromAsset("<additional_folder>/android_fallback.json")` if you placed it in a child folder of 'assets')//if you put the 'android_fallback.json' file to the 'res/raw' directoryval location = FileLocation.fromResId(context, R.raw.android_fallback)//you can also pass a file URIval fileUri: Uri = //get Uri for the file with fallback paywallsval location = FileLocation.fromFileUri(fileUri)//pass the file locationAdapty.setFallback(location, callback)
//if you put the 'android_fallback.json' file to the 'assets' directoryFileLocation location = FileLocation.fromAsset("android_fallback.json");//or `FileLocation.fromAsset("<additional_folder>/android_fallback.json");` if you placed it in a child folder of 'assets')//if you put the 'android_fallback.json' file to the 'res/raw' directoryFileLocation location = FileLocation.fromResId(context, R.raw.android_fallback);//you can also pass a file URIUri fileUri = //get Uri for the file with fallback paywallsFileLocation location = FileLocation.fromFileUri(fileUri);//pass the file locationAdapty.setFallback(location, callback);
Paramètres :
Paramètre
Description
location
L’objet FileLocation pour le fichier de configuration de secours