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

Fix promise not resolving on IOS14 #1064

Merged
merged 1 commit into from
Aug 4, 2020
Merged

Conversation

iaphub
Copy link
Contributor

@iaphub iaphub commented Aug 3, 2020

Hey @hyochan,

We fixed an issue causing the requestSubscription or requestPurchase promise to not resolve on IOS 14 (Issue: #1058)
The issue is due to how react-native-iap is handling the promises, currently a key is generated (using RCTKeyForInstance) which is the pointer of the product identifier.
The problem is the pointer of transaction.payment.productIdentifier is actually different in the updatedTransactions method on IOS 14 causing the key to identify the promise to be different therefore the promise isn't found.
The solution in the pull request is to use directly the product identifier instead of the pointer value.

Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds charming 🌻

@0xleeaki
Copy link

Work in IOS 14 but error in IOS 13, 12...

@iaphub
Copy link
Contributor Author

iaphub commented Oct 12, 2020

Hey @Hobahung, just tested on IOS 12 and no issue.
What's your problem exactly?

@0xleeaki
Copy link

0xleeaki commented Oct 13, 2020

Dear @iaphub iap

It works well when it's not case renew, or renew less than 2 action. This error occurs when I renew an Non-Renewing Subscription or Consumable item several times a day. However, only the error on IOS is less than 14. The RNIap.requestPurchase function still returns the result on IOS14, however it doesn't work on iOS 10 or 12. I am also investigating the cause of this problem. Issue when i click buy button in attached photo. Please see attached photo.

121461327_681622175804774_8800397962450725145_n

@miketrinh1995
Copy link

miketrinh1995 commented Nov 19, 2020

I upgraded to the latest version 4.6.3 and it still not work on requestPurchase vs getSubscriptions. IOS 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 bugfix All kinds of bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants