Solved

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

  • 15 December 2021
  • 1 reply
  • 482 views

Badge +4

Hello,
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:

https://github.com/RevenueCat/purchases-ios/blob/f2b25180ce5b65ec272a5144ed9f61dd135d5cee/Examples/SwiftExample/SwiftExample/SwiftPaywall.swift#L536

 

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.

Expected

introductoryPrice will be null or introPricePeriodNumberOfUnits will be 0.

Actual

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?

 

Thanks,

Tomer.

icon

Best answer by sharif 20 December 2021, 20:49

View original

1 reply

Userlevel 5
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.

Reply