RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
769 stars 84 forks source link

[ANDROID] IntroPrice is null in getOffering() #690

Open basemanabulsi opened 1 year ago

basemanabulsi commented 1 year ago

I am trying to use revenuecat with react native 0.69.5 on Android, the intro price is defined correctly on the store and its active. But the offer is received from the offers, offer identifier has the same ID as the offer ID. The object that has been returned from revenuecat has offerIdentifier correctly but the intoPrice is null. We have defined the offer as Developer determined which I have to determine if the user is eligible of not. Can you help in this?

I found something look like the issue I am facing in flutter SDK https://github.com/RevenueCat/purchases-hybrid-common/pull/446 and it has been fixed before 3 days.

Based on the documentation I can determine anytime I want to set the offer but its not working.

My device:

  1. Huawei Y9s - STK-L21
  2. Has play store
  3. EMUI 12.0.0
  4. Google play system update 2023-05-01 Q
  5. Play Store Version: 36.5.21-29

Packages: "react-native": "0.69.5", "react-native-purchases": "^6.2.3",

This is the object I am getting: I have hided the title, price and identifier for confidentiality

{
   "identifier":"$rc_monthly",
   "offeringIdentifier":"h123",
   "packageType":"MONTHLY",
   "product":{
      "currencyCode":"JOD",
      "defaultOption":{
         "billingPeriod":[
            "Object"
         ],
         "freePhase":null,
         "fullPricePhase":[
            "Object"
         ],
         "id":"p1m",
         "introPhase":null,
         "isBasePlan":true,
         "isPrepaid":false,
         "presentedOfferingIdentifier":"h123",
         "pricingPhases":[
            "Array"
         ],
         "productId":"XXX", // I hided it
         "storeProductId":"XXX:p1m", // I hided it
         "tags":[
            "Array"
         ]
      },
      "description":"One Month Subscription",
      "discounts":null,
      "identifier":"XXX:p1m", // I hided it
      "introPrice":null,
      "presentedOfferingIdentifier":"h123",
      "price": xxx, // I hided it
      "priceString":"JOD xxx", // I hided it
      "productCategory":"SUBSCRIPTION",
      "productType":"AUTO_RENEWABLE_SUBSCRIPTION",
      "subscriptionOptions":[
         [
            "Object"
         ],
         [
            "Object"
         ]
      ],
      "subscriptionPeriod":"P1M",
      "title":"..." // I hided it
   }
}

Can you help in this? please

RCGitBot commented 1 year ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

MarkVillacampa commented 1 year ago

Hello @basemanabulsi

Let's discard a couple things first:

If none of these work, it would be helpful to see a screenshot of your PlayStore product configuration, including the pricing phases (of course feel free to redact as much information as needed for your privacy, I personally use Skitch for that)

basemanabulsi commented 1 year ago

Hi Mark, Thank you for your response, regarding the subscriptionOptions its correct and filled correctly with the 2 phases while the intro price is not correct and its not taken

MarkVillacampa commented 1 year ago

defaultOption should contain the offer with the longest free trial period or the cheapest introductory offer, or the base plan if there is no offer.

Can you confirm if the product identifier for defaultOption is the one for your offer or the one for your baseplan? If it's the base plan, there is either something wrong in the Play Store configuration or the SDK 😄

Additionally, can you post the json for both subscriptionOptions?

Thank you!

AronBe commented 1 year ago

Facing the same issue, have you managed to resolve it @MarkVillacampa ?

Edit: I see it shows only if no previous purchases were made by associated Google Play account, which is probably correct handling. Would be a nice to have a record of "used" offers / free trials as a reference, because as it currently is, one has to basically go and use a new Google account to repeat the flow.

MarkVillacampa commented 1 year ago

That's correct @AronBe. Billing Library only returns products the current user is eligible to use, so it won't return an intro offer that the user has already enjoyed. This is a limitation of the Play Store and there is currently no way to reset the intro eligibility.

For testing purposes, you can use an offer with Developer Eligibility, which will always be available.