Troubleshooting: Expo SDK
Important: Expo SDK 53+ Required
This SDK is exclusively compatible with Expo SDK version 53 and newer. For projects using older Expo versions, please use our legacy React Native SDK.
Common Issues
Paywall Autorotates on Android
If your app is locked to portrait in app.json but the Superwall paywall still rotates on Android, Expo may not be writing the orientation to the SuperwallPaywallActivity in AndroidManifest.xml. Add a config plugin that sets android:screenOrientation for that activity, then run prebuild/EAS build so the manifest is regenerated.
const { withAndroidManifest } = require("@expo/config-plugins");
module.exports = function withSuperwallLockedOrientation(config) {
return withAndroidManifest(config, (config) => {
const app = config.modResults.manifest.application[0];
if (!app.activity) {
app.activity = [];
}
// Look for SuperwallPaywallActivity
const paywallActivity = app.activity.find(
(activity) =>
activity.$["android:name"] ===
"com.superwall.sdk.paywall.view.SuperwallPaywallActivity",
);
if (paywallActivity) {
// Override orientation if activity already exists
paywallActivity.$["android:screenOrientation"] = "portrait";
} else {
// Inject if missing
app.activity.push({
$: {
"android:name":
"com.superwall.sdk.paywall.view.SuperwallPaywallActivity",
"android:theme": "@style/Theme.MaterialComponents.DayNight.NoActionBar",
"android:configChanges": "orientation|screenSize|keyboardHidden",
"android:screenOrientation": "portrait",
},
});
}
return config;
});
};Support
We are always improving our SDKs and documentation! The Expo SDK is being actively developed, and we're committed to making it the best way to integrate paywalls into your Expo projects!
If you have any thoughts on how to improve or know of any other causes, please leave feedback below! If you have any issues not covered here please contact Support or open an issue on GitHub.
How is this guide?
Edit on GitHub