Skip to main content
Question

[React-Native] How to implement addShouldPurchasePromoProductListener?


Forum|alt.badge.img+2

Hello,

 

I want to be able to process subscriptions that come from App store promos.

I found out that this method ‘addShouldPurchasePromoProductListener’ is should be able to process it, but I can’t find an example or doc of how to properly implement it.

 

In my app users have to sign up first before using an app, so what if they click on that promo in the appstore before signing up, what should be the app behavior and method implementation in such case?

2 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 418 replies
  • August 1, 2023

Hi, you can check out how to implement this in our Github. Note that you'll need to add a listener to the `addShouldPurchasePromoProductListener` method that will be called when a purchase is started from the App Store: https://github.com/RevenueCat/react-native-purchases/blob/aed569630b757064c928584c5891f45c1f8a95b2/index.js#L190

 

If your users click on the promo in the App Store before signing up, then you’ll want to use delegates. As the app will not be in a state to make a purchase since the user has not singed up yet, you’ll want to cache the defermentBlock, then call the defermentBlock after the user signs up, aka when the app is ready to make the promoted purchase. See our documentation here: https://www.revenuecat.com/docs/configuring-sdk#ios


Forum|alt.badge.img+2
Haley Pace wrote:

Hi, you can check out how to implement this in our Github. Note that you'll need to add a listener to the `addShouldPurchasePromoProductListener` method that will be called when a purchase is started from the App Store: https://github.com/RevenueCat/react-native-purchases/blob/aed569630b757064c928584c5891f45c1f8a95b2/index.js#L190

 

If your users click on the promo in the App Store before signing up, then you’ll want to use delegates. As the app will not be in a state to make a purchase since the user has not singed up yet, you’ll want to cache the defermentBlock, then call the defermentBlock after the user signs up, aka when the app is ready to make the promoted purchase. See our documentation here: https://www.revenuecat.com/docs/configuring-sdk#ios

Thank you, I will try that


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings