Question

[React-Native] How to implement addShouldPurchasePromoProductListener?

  • 24 July 2023
  • 2 replies
  • 26 views

Badge +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

Userlevel 4
Badge +8

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

Badge +2

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