Solved

Implementing Developer Determined Offer with Android

  • 29 May 2023
  • 1 reply
  • 221 views

Badge

I’m trying to apply a developer-determined offer in the app.
Using react-native-purchases 6.0.0.

I’m able to fetch the Offerings using `Purchases.getOfferings()` and I can see the discount as an option in what is returned.
 

packageType: 'MONTHLY',
product:
{ discounts:
[ { cycles: 12,
periodNumberOfUnits: 1,
priceString: '$2.99',
period: 'P1M',
price: 2.9899999999999998,
periodUnit: 'MONTH',
identifier: '12_month_25_percent' } ],

However, I am unsure on how to then apply this offer.
purchasePackage and purchaseSubscriptionOption each don’t seem to offer an option to apply the discount.
purchaseDiscountedProduct  and purchaseDiscountedPackage say they only apply only to iOS.

So how should I apply a developer determined offer in android when making a purchase?

https://www.revenuecat.com/docs/google-play-offers#eligibility-criteria

icon

Best answer by MarcosC 30 May 2023, 10:00

View original

1 reply

Userlevel 3
Badge +6

Hi @erica- 

In RN6 (beta version), in android, a store product is a base plan within a subscription. Each store product has a list of subscriptionOptions (the base plan and one per offer). A store product also has a defaultOption which is the best options based on our rules (https://www.revenuecat.com/docs/subscription-offers#google-play)

You have a few methods in RN to perform the purchase:

  • purchaseStoreProduct: It will purchase use the defaultOption as the one used to perform the purchase. (purchasePackage and purchaseProduct work the same way)
  • purchaseSubscriptionOption: It will use the subscriptionOption passed as parameter to perform the purchase. In this case, you can decide which offer is being purchased

 

Reply