Question

Sandbox (Expo) popup re-appears (loop) after I hit subscribe, no record in Revenuecat, why?

  • 28 October 2023
  • 11 replies
  • 294 views

Badge +1

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 purchase, it does not show the `console.log` after the function: 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)
}
}


 

Some screenshots:

 


11 replies

Badge +1

Another point is the email that I first tried, is frozen there and I am not able to try another test user, is there a way to change it? 

Thanks

Userlevel 3
Badge +6

Hi @shalaw-fatah-5f5d8e,

I am actually able to see purchases coming through for your test user and am able to view them in the RevenueCat dashboard, so your purchase flow does seem to be working. Regarding the frozen screen - I’d recommend just closing out your app and reopening - that in particular sounds like the simulator just getting stuck. It can be a little quirky, we recommend testing with a device when possible.

Badge +1

Hi @kaitlin I was able to solve the issue. I’m new to mobile development. I thought Expo will ship the environment variables (required by the API) to the App on test flight, but it seems it’s not like that and that was the issue as far as I know. Basically I had to integrate the API keys into where the call is made instead of keeping them in the `.env` file. 

Hello! 

I have the same problem running in the simulator with a sandbox user, but it has nothing to do with environment variables. Simply every time I subscribe and receive a "done" the modal appears again.

Need help :/
 

In testflight it is ok.

 

 

Badge +2

I am having this same issue. Sounds like maybe a bug?

Badge

Same issue for me. Paywall pops up again and again after subscribing

Badge

Same issue here.

Badge

Same issue here, with a pure swiftUI app.

Same issue for me for a React Native project.

Badge +1

Same issue here. Generally I did not care about this since the Sandbox purchase works on real devices on both iOS and Android as well as in Production. The problem is that the App Store reviewer has these problems and rejects app updates due to this issue.


Weird since I have another App where they did not care, I guess this is just based on luck with the App Store reviewer. I updated to the latest React Native release, still does not work.

 

Happens to both a real user and sandbox user created specifically to try this.

Also tried resetting the Simulator and used different devices, still no fix.

It keeps looping until you cancel, on cancel you get the “Purchase was cancelled.” error. While this is looping you get no error or success message.

Having the same problem with the simulator.

After following the instructions here: https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#ios-14-only-testing-on-the-simulator

The iOS modal shows up, gets the check mark, and then the modal shows up again.

Reply