hyochan / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.hyo.dev
MIT License
2.86k stars 648 forks source link

iOS Offer Code Redemption does not trigger purchaseUpdatedListener #1721

Closed grxp-charlie closed 2 years ago

grxp-charlie commented 2 years ago

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

  1. Trigger Offer Code Redemption flow via either presentCodeRedemptionSheet or AppStoreConnect url https://apps.apple.com/redeem?context=offercodes&id=#######&code=CODE
  2. Successfully redeem Offer Code
  3. Return to app
  4. purchaseUpdatedListener receives event and and the receipt is received for backend validation

Actual behavior

  1. Trigger Offer Code Redemption
  2. Successfully redeem Offer Code
  3. Return to app
  4. purchaseUpdatedListener never receives the event. Force fetching receipt via getReceiptIOS 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):

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!

andresesfm commented 2 years ago

Have you tried with the latest @grxp-charlie ?

aidan-doherty commented 2 years ago

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.

bperlman commented 1 year ago

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.

ahunter135 commented 1 year ago

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

Pingou commented 10 months ago

@grxp-charlie @bperlman Did anyone manage to get it working?

grp06 commented 8 months ago

Same question, did anyone figure this out?

coryschadt commented 1 month ago

@grp06 Did you ever get any traction on this?