How to implement In-App Purchases Subscription in Flutter? - flutter

I want to provide auto renewable subscription in my Flutter App for both iOS and Android devices. Users can subscribe for 1 Month.
There is not an officially maintained in-app purchase plugin yet. But there are lots of plugins about In-App Purchases in Flutter.
Which one is the best? How to implement? Are these secure?

==== UPDATE from 11.03.2020
Hi, I can see this post still reading by people who looking for a
method of how to work with subscription in Flutter. During 2019 I made
two apps with thousands install where users can buy a renewable
subscription on the 2 platforms. Until February 2020 I used for this
package from Flutter team https://pub.dev/packages/in_app_purchase,
BUT - there is no way to get info about the user to unsubscribe in
iOS. This is not the plugin issue, but the iOS approach for the
process. We should implement our own backend for security reasons (by
the way Google also recommends to do the same, but still left the way
to check the state directly from the app).
So, after some researches, I found guys who made backend and plugin
and it is free until you have less than 10 000 USD revenue for the
month. https://www.revenuecat.com/
https://pub.dev/packages/purchases_flutter
I've implemented this plugin in my apps and it works like a charm.
There is some good approaches that allow you to get a subscription
state at any point in the app. I'm going to make an example and
article, but not sure about the timing.
==== UPDATE from 03.10.2019
I recommend using new package from Flutter
team https://pub.dev/packages/in_app_purchase
The example with code is here https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase/example
With this plugin I successfully implemented payments and recursive
subscriptions to Android and iOS simultaneously. With the old package I
had some minor issues.
You can use nice plugin flutter_inapp_purchase
I've used it for the app that I developed and it works well. You can use my example of how to work with subscription - github
There is a complete working example - when you run it, you should get the screen
(do not forget to log in to Google play in an emulator or you will get “in-app billing version 3 NOT supported”)

For those looking for resource on how to implement IAP, Flutter team wrote a tutorial using in_app_purchase package and Firebase as backend for validation.
Link: https://codelabs.developers.google.com/codelabs/flutter-in-app-purchases#0

Android and IOS both with In-App-Purchase with auto-renew working best and easy way in Revenuecat plugin Link https://docs.flutterflow.io/advanced-functionality/payments/revenuecat

Related

Which one is good RevenueCat or in_app_purchase library for Flutter In app purchases?

I have an application published in the Appstore and Google Play Store. Which one should I use for this?
Well, while the in_app_purchase package is the official package from flutter, you have to write a complete backend that communicates with the Google Play server and the Apple Appstore server to verify your subscriptions and consumables/non-consumables what is really important to protect your app from fraud.
However RevenueCat's servers handle that validation process for you.
I personally always prefer using official packages, but if your app is generating lower revenue/has not so much users/... its probably worth it to use RevenueCat's Plugin in the beginning as you save a lot of time and it is free to use up to a monthly revenue of 10,000$
Later if your app is generating higher revenue you can consider writing your own backend.

Specify Google Play Store subscription offer with Flutter in_app_purchase package

I am implementing a discount system for subscriptions in my Flutter application, but I do not know how present different Google Play Store subscription offers with the Flutter in_app_purchases package depending on whether or not a user has a coupon code.
How can I present a specific Google Play subscription offer to a user (different than just the base subscription plan) using Flutter's in_app_purchase package?
My understanding from the in_app_purchase package docs is that I can pass the product ID of my subscription, but how can I pass in specific subscription offer?
Thanks!
I have also been looking for the same thing, but apparently it is not yet supported by the flutter plugin. Google Play Offers are quite recent, maybe we will need to wait for a while before it is available.
I opened already an issue regarding this (https://github.com/flutter/flutter/issues/110909).
I will update this answer as soon as I have something new.

Flutter in-app-purchase non-renewing-subscription

I want to make a periodic pass item(ex: 1 week pass, 1 month pass) for remove ads and access premium contents to user.
I saw Android has consumable, non-consumable, subscription.
And IOS has consumable, non-consumable, auto-renewable-subscription, non-renewable-subscription.
But in Flutter's In-App-Purchase, there's only two options: consumable and none-consumable.
How can I implement this to flutter app in Android and IOS both with In-App-Purchase?
You have to make your custom logic for it that will will work fine. I will suggest you to go with cron package to make the periodic tasks over android side workmanager is the best but it doesnt works over ios side but cron does. Alternatively you can get the work done with firebase schedule functions but its a bad approach the best one is cron with flutter in app purchase I've done similar task with over ios side as well.
Android and IOS both with In-App-Purchase with auto-renew working best and easy way in Revenuecat plugin
Link https://docs.flutterflow.io/advanced-functionality/payments/revenuecat

How do I Integrate RevenueCat to my flutter sample app?

I am trying to explore the RevenueCat for in app purchase applications. I want to build a sample application which shows some products with purchases & subscriptions. Can I integrate the RevenueCat for my flutter sample application or do I need a real application to check that flow.
In order to usefully test in-app purchasing code you have to have published the test app to Google Play or the App Store. So, yes, you need a 'real' app, even though it may only ever exist in 'internal testing' on the store.
You also have to do the testing on a physical device. This is true whether you use RevenueCat or another package.
Follow the RevenueCat docs and blogs and check the Flutter example app. The information they provide is very comprehensive. There are also a couple of good Medium articles that you can search for.
BTW, if your app will be monetized with renewable subscriptions rather than one off purchases, I suggest you stick with RevenueCat as the other Flutter packages currently don't help in that area. Been down that road :-)

Is it allowed to do subscriptions for unlocked feature version at app store? (not cloud nor web based)

my app is like an iPod for web articles.
You can listen to the web articles. http://lisgo.org/
I am working on a free version with in-app-purchase now.
But, I'm not sure if I can do subscriptions model for a upgraded version on app store.
There is no web version for my app, even though it needs to connect to the internet for
article parser.
For example, I want to do like this.
Free version = ads, voice speed 1x only, no offline mode.
Premium version (subscriptions) = no ads, multiple voice speeds, offline mode.
I have not seen apps which unlock their features on subscriptions unless it has been
provided as a web SaaS service. And, my friend told me it is against apple's guide line,
but I couldn't find the page states that rule.
Any advice will be appreciated so much!
Thanks.
Apple said to me that auto-renewable subscriptions are only allowed to publishers, not for web service vendors.
It seemed that I can try non auto-renewable subscriptions because they suggested it, but I haven't tried it yet. I believe one time in-app-purchase is good for my model for the moment.
The author of Instapaper also talked about this on his podcast, and he needs to use non-renewable subscriptions for his additional subscription model.