Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to iTunes store #875

Closed
syedmuhammadwaqas opened this issue Dec 12, 2019 · 13 comments
Closed

Cannot connect to iTunes store #875

syedmuhammadwaqas opened this issue Dec 12, 2019 · 13 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS 🚶🏻 stale Stale Stale

Comments

@syedmuhammadwaqas
Copy link

syedmuhammadwaqas commented Dec 12, 2019

Version of react-native-iap

4.3.0

Version of react-native

0.61.5

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

iOS 13 and later

Expected behavior

It should go for purchase or restore the product but it is getting error.
Code:
try{
const purchases = await RNIap.getAvailablePurchases();
if (purchases && purchases.length > 0) {
this.setState({isLoading: false});
Alert.alert('Restore Successful');
}else{
this.requestPurchase(itemSku);
}
}catch(err){
Alert.alert(err.message);
}
After this it's going to catch with error "E_UNKNOWN Cannot connect to iTunes Store" while user did not clicked any option.

Tested environment (Emulator? Real Device?)

I tested on both and behavior is same.

AppStore Review

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.2.3 on Wi-Fi.

Specifically, an error message was displayed when we attempted to purchase.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.

Resources

You can learn more about testing in-app purchase products in your development sandbox environment in App Store Connect Developer Help.

For more information on receipt validation, please see What url should I use to verify my receipt? in the In-App Purchase FAQ.

Learn how to generate a receipt validation code in App Store Connect Developer Help.

Please see attached screenshot for details.
Screen Shot 2019-12-13 at 2 27 06 AM

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Dec 13, 2019
@mustafaaksoy
Copy link

same issue...

@ctohster
Copy link

same, anyone solved?

@messivite
Copy link

I resolved this issue

@syedmuhammadwaqas
Copy link
Author

I resolved this issue

How, can you share ?

@leelandclay
Copy link

There's nothing really to solve here. It's a notification that the User canceled.
Change your error listener to check for that code (E_USER_CANCELLED) and if it is returned, don't activate the subscription or provide the service and then let it fail quietly.

If you had not made any state changes in the purchase call, just add this:

if (error.code === "E_USER_CANCELLED") { return; }

as the first line of the listener's call block. That will just simply return back to the screen they were on. If you need to make changes to the state first, then instead of return; use something like this

if (error.code === "E_USER_CANCELLED") { 
  this.setState({ subscription: undefined, userCancelled: true, whateverElse: 'completed' }, () => { return; });

@Burkazoid
Copy link

+1 - also experiencing this issue.

There's nothing really to solve here. It's a notification that the User canceled.
Change your error listener to check for that code (E_USER_CANCELLED) and if it is returned, don't activate the subscription or provide the service and then let it fail quietly.

That's not the code in his original post.

@stale
Copy link

stale bot commented Jun 2, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the 🚶🏻 stale Stale label Jun 2, 2020
@mustafaaksoy
Copy link

This problem sandbox user only run Testflight app. I tested my app on testfligt. its working.

@stale stale bot removed the 🚶🏻 stale Stale label Jun 2, 2020
@stale
Copy link

stale bot commented Sep 2, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the 🚶🏻 stale Stale label Sep 2, 2020
@L-Yeiser
Copy link

We see this error consistently in tesflight but intermittently on production. Anyone find any solutions?

@stale stale bot removed the 🚶🏻 stale Stale label Sep 30, 2020
@stale
Copy link

stale bot commented Dec 31, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the 🚶🏻 stale Stale label Dec 31, 2020
@stale
Copy link

stale bot commented Jun 4, 2021

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale
Copy link

stale bot commented Jul 8, 2021

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS 🚶🏻 stale Stale Stale
Projects
None yet
Development

No branches or pull requests

8 participants