30

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?

David
  • 1,071
  • 3
  • 11
  • 13
  • I haven't done any development myself with flutter, but I'm looking deep into it. Have you seen this plug-in yet? https://pub.dartlang.org/packages/flutter_iap. It seems like it can do In-App purchases as well as subscriptions. I'm curious about this too, so I'd like to know how it turns out! I'm going to start development soon. – user3002092 Jan 03 '19 at 23:52
  • 3
    As of July 2019, there seems to be official in-app purchase support plugin supported by google/flutter team. https://github.com/flutter/plugins/tree/master/packages/in_app_purchase – user482594 Jul 06 '19 at 18:33

3 Answers3

28

==== 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

enter image description here

(do not forget to log in to Google play in an emulator or you will get “in-app billing version 3 NOT supported”)

awaik
  • 10,143
  • 2
  • 44
  • 50
  • can I run the github starter code on the emulator? Are there any specific changes that I would need to make in the google play developer console? Or is this run of the mill? Thanks. – bhavs May 02 '19 at 13:25
  • Yes, you can run it, it should work without any changes. (do not forget to log in to Google play in emulator or you will get “in-app billing version 3 NOT supported”) – awaik May 03 '19 at 13:19
  • 1
    Newbie Question. Do I have to have a release ready apk and release the same on the google play . Is there a testing / internal dev way of doing this without releasing the app. – bhavs May 11 '19 at 05:39
  • I usually test .apk file. So - I send it to myself and install on the devices (phones or tablets). After these preliminary tests I create release for Internal test track in Google play. Picture https://imgur.com/a/bEldKy8 – awaik May 11 '19 at 14:27
  • 1
    So this was launched a 2 days ago -- https://pub.dev/packages/in_app_purchase . I am looking at making use of this.. I hope this reduces the overhead to test . But thanks for your support thus far. – bhavs May 13 '19 at 07:34
  • 2
    No, it was launched far more earlier. You've looked to the update date. Versions history is here https://pub.dev/packages/in_app_purchase#-changelog-tab- – awaik May 13 '19 at 14:25
  • I tried running your example app on my emulator and physical device but it doesn't show the widget with the card. – Michael Hathi Oct 03 '19 at 11:22
  • Now I would recommend to use plugin from Flutter team pub.dev/packages/in_app_purchase So, try to use their example https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/example it works well. I switched to their package and it helped me to solve problems with payments on iOS. – awaik Oct 03 '19 at 13:13
  • @awaik do you make any tutorial for revenuecat? I try it on iOS working fine on android I cannot get any offerings – Evripides Kyriacou Aug 21 '20 at 12:08
  • @EvripidesKyriacou Hi, sorry, have no time for this. The usual problem is the wrong settings. Check that you have made all credentials correctly https://docs.revenuecat.com/docs/creating-play-service-credentials – awaik Aug 21 '20 at 12:57
  • I tried it and I think I configured correct, this will be work on simulator or I have to published on a closed track? – Evripides Kyriacou Aug 21 '20 at 13:52
  • ohh, it does NOT work on the simulator. But you can run the app on the real device from your IDE and it will work. – awaik Aug 21 '20 at 19:03
  • Hey sir, ty for this answer, regarding RevenueCat, we need to give them API access, is it secure? – Lidor Eliyahu Shelef Aug 23 '20 at 19:53
  • Hi Lidor, they can't get your money or some sensitive data. But they get full info about purchases and products. For me it's ok. – awaik Aug 24 '20 at 09:27
  • By the way, it is a good question, you can ask their support and share with us. – awaik Aug 24 '20 at 09:28
  • is the new plugin totally free? – JayVDiyk Jun 23 '21 at 12:46
  • Plugin yes, but the cloud service free only up to 10000$ revenue per month. – awaik Jun 24 '21 at 13:17
2

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

JT501
  • 1,407
  • 15
  • 12
-1

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

P.J.Radadiya
  • 1,493
  • 1
  • 12
  • 21