Solved

Flutter/Android v5.0: introductoryPrice is null

  • 16 June 2023
  • 2 replies
  • 209 views

Badge +2

I switched today from Flutter v4.11.3 to v5.0.0 and I noticed that the introductoryPrice property value changed to null. In my Google Play app, I am logged in with an email that I have not yet used with a subscription so I am assuming that this email/account is eligible for a free trial.

I am using my Samsung S22 device in both scenarios and I am running my app in debug mode (I haven’t tested it in production),

v5.0.0:


final storeProduct = offerings.current?.availablePackages.first.storeProduct;
debugPrint('storeProduct: $storeProduct');

// console:

I/flutter (10661): storeProduct: StoreProduct(identifier: hairapp:monthly-auto-renewing, description: The description from the subscription details in Play console, title: Subscription for Hair App (Hair App), price: 5.99, priceString: €5.99, currencyCode: EUR, introductoryPrice: null, discounts: null, productCategory: ProductCategory.subscription, defaultOption: SubscriptionOption(id: monthly-auto-renewing, storeProductId: hairapp:monthly-auto-renewing, productId: hairapp, pricingPhases: [PricingPhase(billingPeriod: Period(unit: PeriodUnit.month, value: 1, iso8601: P1M), recurrenceMode: RecurrenceMode.infiniteRecurring, billingCycleCount: 0, price: Price(formatted: €5.99, amountMicros: 5990000, currencyCode: EUR), offerPaymentMode: null)], tags: [], isBasePlan: true, billingPeriod: Period(unit: PeriodUnit.month, value: 1, iso8601: P1M), isPrepaid: false, fullPricePhase: PricingPhase(billingPeriod: Period(unit: PeriodUnit.month, value: 1, iso8601: P1M), recurrenceMode: RecurrenceMode.infiniteRecurring, billingCycleCount: 0

v4.11.3:


final storeProduct = offerings.current?.availablePackages.first.storeProduct;
debugPrint('storeProduct: $storeProduct');


// console:

I/flutter (12179): storeProduct: StoreProduct(identifier: hairapp, description: The description from the subscription details in Play console, title: Subscription for Hair App (Hair App), price: 5.99, priceString: €5.99, currencyCode: EUR, introductoryPrice: IntroductoryPrice(price: 0.0, priceString: €0.00, period: P1W1D, cycles: 1, periodUnit: PeriodUnit.day, periodNumberOfUnits: 8), discounts: null, subscriptionPeriod: P1M)

 

My subscription setup in Googl Play Console:

My flutter version is 3.10.5:

flutter --version
Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (3 days ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

 

This issue seems related to:

and issues: https://github.com/RevenueCat/purchases-flutter/issues/329#issuecomment-1047208703 and https://github.com/RevenueCat/purchases-flutter/issues/333. The only difference here is that for me, its only happening for v5.0 and is working fine for v4.x.  So it seems the issue is also present in Billing Library v5.

 

Now, does this issue affect the user eligibility for a free trial? In other words, when a user who is eligible for a free trial tries to subscribe to my app, will he/she get the free trial even though the introductoryPrice is null?

icon

Best answer by Nader 18 June 2023, 20:43

View original

2 replies

Badge +2

Update:

I was able to get the free trial info using v5.0:  storeProduct?.defaultOption?.freePhase  is not null using an emulator and a Google Play account that was not used before with a subscription.

However, when I test on my actual S22 device with the same Google Pay account as above, storeProduct?.defaultOption?.freePhase is null. Note that on my S22 device, I have previously tested subscribing with a free trial with a different Google Play account.

Therefore, it seems that if a device had previously had a subscription with a free trial, Billing Client 5 will assume that the user is no longer eligible for a free trial and will therefore set the freePhase property to null. I am not sure about this but this is my understanding so far. Can anyone comment or provide feedback on that? 
 

Thanks.

Userlevel 3
Badge +6

Hi @Nader 

Adding to your update, when you create an offer, you can define the eligibility criteria. For the first two, Google decides whether the user matches the criteria or not. If you are not happy with that, you can try creating a dev determined offer. 

 

 

Reply