Cannot connect to iTunes Store for sandbox users
See original GitHub issueVersion of react-native-iap
2.2.2
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
await RNIap.buyProduct(MIXED_PACK);
should not fail
Actual behavior
I get the error Cannot connect to iTunes Store
even if I use a sandbox user
Tested environment (Emulator? Real Device?)
Real device, iPad and iPhone 7
Steps to reproduce the behavior
Just try to run that piece of code. I have read thoroughly the Blog to create a sandbox environment here https://medium.com/@dooboolab/react-native-in-app-purchase-121622d26b67
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Cannot connect to iTunes sandbox | Apple Developer Forums
I am getting the following error for the sandbox purchase. Is the sandbox down or is there any way to find out. The...
Read more >IAP Cannot connect to iTunes Store | Apple Developer Forums
Create a new iTunes Sandbox user. Do NOT verify the email address. · Sign out of the App Store on your device. ·...
Read more >In app purchase “Cannot connect to… - Apple Developer
In app purchase “Cannot connect to iTunes Store” error for Sandbox user. We're using sandbox for testing auto renewing IAP but most of...
Read more >Unable to view the sandbox user account in iOS14 devices
Open settings · Search Bar type "store" · Select In-App Ratings & Reviews · Scroll down to the bottom · Look at Sandbox...
Read more >Cannot connect to iTunes Store Code 0 - Apple Developer
Cannot connect to iTunes Store Code 0 · 1) Set up new sandbox account in ItunesConnect · 2) Vefified email. · 3) On...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone else stumbling onto issue, also note “Your app is running in the Simulator, which does not support in-app purchase.” is another reason that you may get this error. Must do this on a real device.
@dooboolab I have tried using both
RNIap.buyProduct(sku)
andRNIap.buyProductWithoutFinishTransaction(sku)
withRNIap.finishTransaction()
, and for both I have usedRNIap.validateReceiptIos(receiptBody, true);
, withconst receiptBody = {'receipt-data': purchase.transactionReceipt, password: '[apple-id-password]'};
, but no luck. Also it is worth noting that whichever password I put in ‘[apple-id-password]’,validateReceiptIos
response is always the same. This is an example:As you might have noticed,
receipt_type: 'ProductionSandbox'
, which should be caused by the fact I am using a real Apple ID username in a sandbox environment (I am not able to create a working test sandbox user, thank you Apple for making our life a living hell).