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

iOS requestSubscription not initiating new purchase and getAvailablePurchase consider the purchase still as a renewal #2844

Open
ivannzme opened this issue Sep 11, 2024 · 0 comments

Comments

@ivannzme
Copy link

ivannzme commented Sep 11, 2024

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description
iOS 15.4.1
"react-native": "0.68.7",
"react-native-iap": "12.15.0",

Purchase the expired subscription again, the native iOS purchase pop did not show at all
getting the below:

LOG [11/9/2024, 3:34:34 pm] 💰 requestBuySub() reqOpts: {"andDangerouslyFinishTransactionAutomaticallyIOS": false, "sku": "productId-here"}

LOG [11/9/2024, 3:34:34 pm] getAvailablePurchases result [{"appAccountToken": "", "originalTransactionDateIOS": 1725940011000, "originalTransactionIdentifierIOS": 2000000709571345, "productId": "productId-here", "purchaseToken": "", "quantityIOS": 1, "transactionDate": 1725943768000, "transactionId": "2000000709603840", "transactionReasonIOS": "RENEWAL", "transactionReceipt": "", "verificationResultIOS": ""}]

LOG [11/9/2024, 3:34:34 pm] 🎯 handlePurchaseUpdatedListener({productId, transactionId, originalTransactionIdentifierIOS}) productId-here 2000000709603840 2000000709571345

LOG [11/9/2024, 3:34:34 pm] requestSubscription result

noticed that purchaseUpdatedListener is triggered before requestSubscription returns the result, and from getAvailiablePurchases, it is still considering the subscription is in a renewal process

Tested on iOS 15.8, 16.7.10, 17.5.1, all seems to work as expected without problems.
getAvailablePurchases returns an empty array for the three iOS version mentioned above

Expected Behavior
Expecting to see the native iOS purchase pop up appear and user can purchase the expired subscriptions again

Screenshots

Environment:

iOS 15.4.1
"react-native": "0.68.7",
"react-native-iap": "12.15.0",

To Reproduce
Steps to reproduce the behavior:

1.Purchase a subscription
2. go to Settings -> App Store -> tab on the apple account -> Manage -> find the subscription
3. cancel the subscription
4. wait for it to expire
5. come back to the app and make the purchase to that exact same one again
6. the native iOS purchase pop up did not show


[Optional] Additional Context

tried checking getPendingPurchasesIOS (returns an empty array everytime when the subscription has expired), clearTransactionIOS, still no luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant