[Flutter & iOS] still get introductoryPrice even after user cancel trial before

  • 15 December 2021
  • 1 reply

Badge +3

I implemented a subscription plan with 7 days of trial in my app using Flutter SDK version 3.2.2. 
Since I didn’t find an example for Flutter, I used this iOS code as a reference to implement the text for Trials period:


I currently see some strange behavior after the user started the trial and cancel it before the trial ended. 
When the user opens the subscription screen again after the trial ended, I’m using the getOfferings function to fetch the current offerings and I still get the introductoryPrice object. 
In the code example above I see that you check if the introductoryPrice object is not nil and based on this show to the user the introductory price text.
So now, If the user cancels the trial, and then wants to subscribe again, It seems like the intro price is available but in fact, when he makes the purchase he will be billed immediately without any trial period.


The exact scenario to reproduce it:

  1. Start free trial on iOS
  2. Before the trial ends, Cancel the trial via the app store subscriptions screen.
  3. Wait until the trial ended when the user lost his entitlement.
  4. use the function getOfferings to get the current offerings.


introductoryPrice will be null or introPricePeriodNumberOfUnits will be 0.


introductoryPrice is not null and introPricePeriodNumberOfUnits is bigger the 0 (in my case it 7 days)


Is this is a bug? If not what is the practice in flutter to check the introductory price if not checking the introductoryPrice object?





Best answer by sharif 20 December 2021, 20:49

View original

1 reply

Userlevel 4
Badge +9

The introductoryPrice is not meant to be used to check whether the user eligible for the introductory price - it’s simply the introductory price of the product. Instead, you should use the checkTrialOrIntroductoryPriceEligibility method. It only works on iOS but is available on the native iOS SDK and the hybrid SDKs (including Flutter.) There isn’t an equivalent on Android since Billing Library doesn’t provide this functionality, but you can check the user’s past purchases to make a good guess as to whether the user already redeemed the introductory price.