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 Offer Code Redemption does not trigger purchaseUpdatedListener #1721

Closed
grxp-charlie opened this issue Jun 13, 2022 · 9 comments
Closed
Labels
📱 iOS Related to iOS

Comments

@grxp-charlie
Copy link

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):

  • getAvailablePurchases: Errors out with The 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 with The operation couldn’t be completed. (SKErrorDomain error 2.) during the first couple minutes after login and then resolves to an empty array.
  • getPromotedProduct: Always resolves null
  • getReceiptIOS: Resolves with some encoded receipt data. Passing the receipt data to the validator API does show us the latest receipt object in the latest_receipt_info array has the offer_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!

@andresesfm
Copy link
Contributor

Have you tried with the latest @grxp-charlie ?

@andresesfm andresesfm added the 📱 iOS Related to iOS label Jun 14, 2022
@aidan-doherty
Copy link

aidan-doherty commented Jul 12, 2022

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
Copy link

bperlman commented Dec 27, 2022

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
Copy link

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
Copy link

Pingou commented Jan 17, 2024

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

@grp06
Copy link

grp06 commented Feb 23, 2024

Same question, did anyone figure this out?

@coryschadt
Copy link

@grp06 Did you ever get any traction on this?

@steyer-mika
Copy link

Got the same issue, any updates?

@manan-schmooze
Copy link

Why is this issue closed? I don't think it is resolved and I am also still facing this issue

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

No branches or pull requests

10 participants