Hello everyone,
I got RevenueCat working with Expo iOS development build but when I submit to appstore or even do a local preview build, app crashes on startup.
I connected my iPhone to my mac with cable and launched the console app. And when I filtered the streaming console I found this error that caused the crash
RevenueCatUI/DebugErrorView.swift:68: Fatal error: Purchases has not been configured.
However, I did configure the Purchases at the very root in my App.js
I tried these both…
const configurePurchases = async () => {
if (Platform.OS === "ios") {
Purchases.configure({ apiKey: process.env.EXPO_PUBLIC_RC_IOS });
}
};
configurePurchases();
and…
const configurePurchases = async () => {
if (Platform.OS === "ios") {
Purchases.configure({ apiKey: process.env.EXPO_PUBLIC_RC_IOS });
}
};
useEffect(() => {
async function init() {
await configurePurchases();
}
init();
}, []);
They both work at the development build on a physical device.
But they both crash at startup on TestFlight or local Preview Build.
And when it crashes Mac Console App says..
“RevenueCatUI/DebugErrorView.swift:68: Fatal error: Purchases has not been configured.”
It was working fine before. I don’t know what happened or how to fix this.
Can anybody help?