Skip to main content
Question

How to setup free trial offer in Flutter and Google Play?

  • January 29, 2025
  • 1 reply
  • 89 views

Forum|alt.badge.img

How to set up the free trial offer in Flutter and Google Play?

 

In my Google Play Store Console, I have setup the base plan. I have then setup a trial 7 day offer. 

The offer is now separate from the base ID. When I use the base ID for my product offerings, it doesn’t automatically grab the Google Play offer. 

How do you implement this, is there a partial example to follow?


From previous post:
 

I don’t have a full example, but sharing some parts of the code to see if it helps (let me know if it doesn’t).

The flutter repository has a sample app called magic weather with a paywall → https://github.com/RevenueCat/purchases-flutter/blob/main/revenuecat_examples/MagicWeather/lib/src/views/paywall.dart

It gets the store product from the available offering and uses it to render the paywall → https://github.com/RevenueCat/purchases-flutter/blob/main/revenuecat_examples/MagicWeather/lib/src/views/paywall.dart#L67-L79

You can use `final freeOffer = storeProduct.subscriptionOptions?.firstWhere((option) => option.freePhase != null);` to check if there’s a free trial option or not.

 

Hope it helps ;) 

These don’t explicitly tell you how to do the free trial? How to implement this?

This post has been closed for comments

1 reply

jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 238 replies
  • January 31, 2025

Hi ​@richhj! What Eligibility criteria have you set for your trial offer? The options are:

  • New customer acquisition
  • Upgrade
  • Developer determined

Apart from Developer determined, Google automatically applies the trial when purchasing the product, provided the user meets the criteria. You simply need to pass the package to purchasePackage, and Google Play’s billing sheet will determine eligibility and apply the trial. More information is available here. Does Google not apply the trial when you attempt a Sandbox purchase?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings