dooboolab-community / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.dooboolab.com
MIT License
2.74k stars 632 forks source link

Testing production version app with Ad Hoc distribution still makes me use sandbox #1265

Closed isonlaxman closed 3 years ago

isonlaxman commented 3 years ago

Version of react-native-iap

5.1.3

Version of react-native

0.63

Platforms you faced the error (IOS or Android or both?)

iOs

Expected behavior

When I use Ad Hoc distribution, I want to see what the production payment flow would look like. However, when I requestSubscription, I'm prompted with a sign in to sign into my sandbox account. The payment popup also tells me that this is a test subscription and that I won't be charged for it.

Actual behavior

I want requestSubscription to actually charge me money so that I can test the whole process.

Tested environment (Emulator? Real Device?)

Real Device with Ad Hoc Distribution

Steps to reproduce the behavior

Code for susbcribe button handler ``` const products = await IAP.getProducts(itemSubs); if ( products.length > 0 && products[0].productId === stringConstants.products.ios.base ) { await IAP.requestSubscription(products[0].productId, false); } else { // show error } ```
Purchase udpated lisener ``` const receipt = purchase.transactionReceipt; if (receipt) { const state = store.getState() as TypeGlobalState; if ( user exists ) { try { // create new subscription on backend // navigate to next screen } catch { // show error } await RNIap.finishTransaction(purchase); } } else { // show error } ```

I use the 'Release' mode everywhere in XCode.

hyochan commented 3 years ago

If I am correct, it looks like your account is registered as a sandbox user so the Apple is not charging you.