Reputation: 1
In Testflight app on iphone, on entering promo code for in-app purchase, I am getting a success message from the app store but purchaseUpdateListener is not being triggered. Tested by adding alerts within purchaseUpdateListener.
I am using the same purchase flow for in-app purchases and that is working fine.
Expected Behavior
Trigger Promo Code redemption using this URL(itms-apps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/freeProductCodeWizard?code=PROMO_CODE') on click of button within app for an in-app purchase. Click Redeem. Success message shown in app store. purchaseUpdatedListener receives an event and receipt.
Actual Behavior
Trigger Promo Code redemption using this URL(itms-apps://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/freeProductCodeWizard?code=PROMO_CODE') on click of button within app for an in-app purchase. Click Redeem. Success message shown in app store. purchaseUpdatedListener receives NO event.
Environment:
react-native-iap:12.10.5 react-native:0.71.8 Platforms (iOS, Android, emulator, simulator, device): Testflight app on IOS real device
Upvotes: 0
Views: 879
Reputation: 41
I've been struggling with this as well on my paywall. If someone submits a promo code through apples website, the device is unaware of it when they are redirected back to my app.
The only fix I can think of is to add a listener that gets triggered by your app going from background to foreground (https://reactnative.dev/docs/appstate). Inside that listener you can check if someone has made the purchase.
This seems a bit hacky since it would get called anytime the app goes from background to foreground. Also open to hearing other solutions!!
Upvotes: 0