question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot connect to iTunes Store for sandbox users

See original GitHub issue

Version 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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

6reactions
ilyausorovcommented, Jun 15, 2019

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.

4reactions
raynor85commented, Oct 9, 2018

@dooboolab I have tried using both RNIap.buyProduct(sku) and RNIap.buyProductWithoutFinishTransaction(sku) with RNIap.finishTransaction(), and for both I have used RNIap.validateReceiptIos(receiptBody, true);, with const 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:

{ receipt: 
   { receipt_type: 'ProductionSandbox',
     adam_id: 0,
     app_item_id: 0,
     bundle_id: 'io.fantastec.swap',
     application_version: '8',
     download_id: 0,
     version_external_identifier: 0,
     receipt_creation_date: '2018-10-09 19:16:09 Etc/GMT',
     receipt_creation_date_ms: '1539112569000',
     receipt_creation_date_pst: '2018-10-09 12:16:09 America/Los_Angeles',
     request_date: '2018-10-09 19:16:10 Etc/GMT',
     request_date_ms: '1539112570436',
     request_date_pst: '2018-10-09 12:16:10 America/Los_Angeles',
     original_purchase_date: '2013-08-01 07:00:00 Etc/GMT',
     original_purchase_date_ms: '1375340400000',
     original_purchase_date_pst: '2013-08-01 00:00:00 America/Los_Angeles',
     original_application_version: '1.0',
     in_app: 
      [ { quantity: '1',
          product_id: 'basic_pack',
          transaction_id: '1000000455003078',
          original_transaction_id: '1000000455003078',
          purchase_date: '2018-10-09 19:16:09 Etc/GMT',
          purchase_date_ms: '1539112569000',
          purchase_date_pst: '2018-10-09 12:16:09 America/Los_Angeles',
          original_purchase_date: '2018-10-09 19:16:09 Etc/GMT',
          original_purchase_date_ms: '1539112569000',
          original_purchase_date_pst: '2018-10-09 12:16:09 America/Los_Angeles',
          is_trial_period: 'false' } ] },
  status: 0,
  environment: 'Sandbox' }

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found