react-native-iap
react-native-iap copied to clipboard
iOS Offer Code Redemption does not trigger purchaseUpdatedListener
Version of react-native-iap: 7.3.0
Version of react-native: 0.66.0
Platforms you faced the error (IOS or Android or both?): IOS
Expected behavior
- Trigger Offer Code Redemption flow via either
presentCodeRedemptionSheet
or AppStoreConnect url https://apps.apple.com/redeem?context=offercodes&id=#######&code=CODE - Successfully redeem Offer Code
- Return to app
-
purchaseUpdatedListener
receives event and and the receipt is received for backend validation
Actual behavior
- Trigger Offer Code Redemption
- Successfully redeem Offer Code
- Return to app
-
purchaseUpdatedListener
never receives the event. Force fetching receipt viagetReceiptIOS
shows a valid receipt
Tested environment (Emulator? Real Device?): Real Device (iPhone and iPad) on TestFlight build pointed to Production environment
Steps to reproduce the behavior
Using react-native-iap v7.3.0 on React Native v0.66.0 with the new iOS Offer Code redemption flow via a TestFlight build pointed to production. We have tested redeeming offer codes via both the presentCodeRedemptionSheet
method and also using the link from App Store Connect (https://apps.apple.com/redeem?context=offercodes&id=#######&code=CODE). The Offer Code is redeemed successfully and the user is charged but our purchaseUpdatedListener
never receives an event after returning to the app or even restarting the app.
I added some logs to try fetching different information before and after the offer code redemption happens (with a brand new user):
-
getAvailablePurchases
: Errors out withThe operation couldn’t be completed. (SKErrorDomain error 2.)
during the first couple minutes after login and then resolves to an empty array. -
getPurchaseHistory
: Errors out withThe operation couldn’t be completed. (SKErrorDomain error 2.)
during the first couple minutes after login and then resolves to an empty array. -
getPromotedProduct
: Always resolvesnull
-
getReceiptIOS
: Resolves with some encoded receipt data. Passing the receipt data to the validator API does show us the latest receipt object in thelatest_receipt_info
array has theoffer_code_ref_name
field that we expect to see on successful offer code redemption.
We set up our purchaseUpdatedListener
soon after app start in the same function where we call getSubscriptions
to setup the app for IAP. Our promoted product listener is mounted even earlier in the app's lifecycle but receives no event either.
I have already reviewed the following issues #400 #450 #490 #1276 but I am still having this problem. Are there any investigations currently underway or solutions in any later versions? At this point we are left having to hack around the lack of a purchase signal. Any help would be greatly appreciated!
Have you tried with the latest @grxp-charlie ?
Got the same issue in version 5.2.14 is annoying offer codes can only be tested on production builds of the apps makes debugging this hellish.
Seem to still be having this issue, while we're reviewing to try to figure this out on our end (exact same scenario and issues reviewed as original issue above) if anyone here has had success getting this to work, would love to know what your solution was.
I'm still having this issue, can anyone help out?
The modal shows, I hit redeem code, the apple prompt shows where it does face ID to redeem, then the modal never hides and the purchase does not go through
@grxp-charlie @bperlman Did anyone manage to get it working?
Same question, did anyone figure this out?