I created this app with Expo and made a couple of offerings with Revenuecat. Now I want to test it. The packages appear,
I hit subscribe, The popup appears, I write password and hit subscribe, It says done (without the tick appearing, just a circle) and the whole popup disappears, but after 3 seconds, the purchase popup (Sandbox) reappears again and again. No matter how many times I hit subscribe, it says done and re-appears. There is no record of subscription in my Revenuecat account (yes the sandbox checkbox ticked), and I have registered a sandbox user (valid email with a password) on App Store users. I’m very new to Sandbox testing and I use iOS simulator (17). Does anyone know what to do form here? Checked the Internet and not much was found.
By the way, the code does not seem to go through anything after the validation, it does not show the console log, after calling the purchase: Here’s the purchase function:
const subscribe = async(item) => {
try {
const {purchaserInfo} = await Purchases.purchasePackage(item)
console.log('purchase info: ', purchaserInfo)
const purchase = await Purchases.getCustomerInfo()
console.log('purchase: ', purchase)
if(typeof purchase.entitlements.active['pro'] !== 'undefined') {
await navigation.navigate('Account')
}
} catch (error) {
console.log(error)
}
}
I expect the function of purchasing to continue, register a test user (subscriber) on Revenuecat dashboard, and show the console results, then navigate to the page marked.
In my case, it was environment variables not being shipped with the app. I thought when I deploy the app into the App Store, somehow env variables will go with it or there is some place where you can register them, but I did not find any. So I just posted the env variables with the code and it worked.