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

iap-promoted-product listener is not working when user come from quit state #2605

Open
Tarun24RN opened this issue Nov 9, 2023 · 1 comment

Comments

@Tarun24RN
Copy link

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

This function is not working when i open app from terminated state and i am unable to get the product details
RNIapEmitter.addListener('iap-promoted-product', async () => {
// Check if there's a persisted promoted product
const productId = await RNIap.getPromotedProductIOS();
ShowLogs('in-app promoted products1',productId)
if (productId !== null) {
// You may want to validate the product ID against your own SKUs
try {
ShowLogs('in-app promoted products2')
await RNIap.buyPromotedProductIOS(); // This will trigger the App Store purchase process
} catch (error) {
console.warn(error);
}
}
});

Expected Behavior

If user open app from terminated state the this listener should work and apple subscription tray should open for the respective product on which user clicks on app store.

Environment:

  • react-native-iap:12.4.8
  • react-native:0.70.6
  • Platforms (iOS, Android, emulator, simulator, device): iOS device

To Reproduce
Steps to reproduce the behavior:
Paste the above in the early lifecycle of app.
Click on below link while your app is in terminated state.
App launch then listener should work but it is not working.
Testing Url
itms-services://?action=purchaseIntent&bundleId=com.example.app&productIdentifier="your Product id"


@jerryphm
Copy link

Same issue here

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

No branches or pull requests

2 participants