Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

getPromotedProductIOS event doesn't trigger at all when opening an app from a terminated state #1398

Closed
amiceli-torstar opened this issue Jun 30, 2021 · 1 comment · Fixed by andresesfm/react-native-iap#5
Labels
📱 iOS Related to iOS

Comments

@amiceli-torstar
Copy link

amiceli-torstar commented Jun 30, 2021

Please use Discussion board if you want get some help out of it. Please report issue if there is a bug.

Version of react-native-iap

4.5.0, 6.2.4, 7.0.1 (tried both versions)

Version of react-native

0.64.2

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

When adding in the snippet of code specified here: https://react-native-iap.dooboolab.com/docs/faq/, I expect the event to fire upon opening the app cold

Actual behavior

When opening an app cold, the listener doesn't appear to fire at all. I've tried putting the initialization code in App.js, and even index.js to see, but it doesn't fire at all.

I also tried using 7.0.1 with the new useIAP hook to just grab promotedProductsIOS directly - it does not work on startup from both a terminated state or background state

When opening an app sitting in the background, the listener does fire, and the productId returned is correct

Tested environment (Emulator? Real Device?)

Real device (Iphone 7, iOS 14.4.2)

Steps to reproduce the behavior

Added the snippet of code from the faq to my codebase, tried running the app. Used test url from https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_promoted_in-app_purchases to try it.

@amiceli-torstar amiceli-torstar changed the title getPromotedProductIOS event doesn't trigger at all when opening an app cold getPromotedProductIOS event doesn't trigger at all when opening an app Jul 7, 2021
@amiceli-torstar amiceli-torstar changed the title getPromotedProductIOS event doesn't trigger at all when opening an app getPromotedProductIOS event doesn't trigger at all when opening an app that is not currently running Jul 7, 2021
@amiceli-torstar amiceli-torstar changed the title getPromotedProductIOS event doesn't trigger at all when opening an app that is not currently running getPromotedProductIOS event doesn't trigger at all when opening an app from a terminated state Jul 8, 2021
@amiceli-torstar
Copy link
Author

Added new test case - tried using 7.0.1 with your useIAP hook to just grab promotedProductsIOS directly - it does not work on startup from both a terminated state or background state

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
📱 iOS Related to iOS
Projects
None yet
2 participants