skip to Main Content

I am integrating in-app purchases in a React Native app using RevenueCat. My use case requires users to be able to buy multiple entitlements, each from its own separate offering/paywall.

The problem I’m having is that the paywall presented to a user is always either the site-wide default, or the manually-overridden default for that particular user. This happens even when I pass offering and requiredEntitlementIdentifier to presentPaywall() or presentPaywallIfNeeded().

My expected behaviour for this is that passing an offering ID to presentPaywall() should override any defaults.

Amy I doing something wrong?

2

Answers


  1. Chosen as BEST ANSWER

    After going through the code for react-native-purchases on Github, I have found the issue. presentPaywall() does not accept the offering identifier, it must receive the actual offering object.

    It would be nice if this were documented.


  2. For references if someone is using Flutter and got in this situation, rember to specify the offering on the presentPaywall, like this :

    Offerings offerings=await Purchases.getOfferings();
    final paywallResult = await RevenueCatUI.presentPaywall(offering: offerings.all.entries.firstWhere((element) => element.value.identifier=="your_offering_identifier").value,displayCloseButton: true);
    log('Paywall result: $paywallResult');//You can use this result for anything you want
                        
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search