Question

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

  • 28 October 2023
  • 21 replies
  • 583 views

Userlevel 1
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:

 


21 replies

Userlevel 1
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 4
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.

Userlevel 1
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.

Badge +3

Same problem here. 

Apparently this problem has at least 3 months and no solution yet? 

The fact that Apple reviewers can't approve updates is really problematic. 

++ same issue here, RN app. 

same here

Same here. Do we have any solution?

Badge +3

Same here - but it works on device. I believe this is an issue with StoreKit configuration file on simulators.

 

"react-native": "0.73.6",

"react-native-purchases": "^7.26.2",

"react-native-purchases-ui": "^7.26.2",

 

same problem

I am experiencing the same problem, any updates on a possible solution? 

Badge

same problem here :(

Hi all, found this thread when experiencing the same problem and thought I would share now I’ve fixed it.

In order to make subscriptions work on simulator you have to do some custom config in Xcode.
https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode?language=objc

Related discussion here: https://github.com/dooboolab-community/react-native-iap/issues/2603

Badge

same issue when we dont use a storekit file but when we use it, it works on simulator but no product is fetched on real device i’m really confused

Reply