Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement In-App Purchases Subscription in 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?

like image 990
David Avatar asked Dec 21 '18 06:12

David


People also ask

How do you implement subscriptions in Flutter?

Go to App Store Connect. Select the app for which you want to create a subscription. In the side menu under the in-app purchase, section select the manage option. Click on the plus sign to add new products and choose the type of subscription you want.

How do you test in-app purchase on Flutter?

For testing your IAP, you need to create a sandbox tester account. Go to app store connect -> Users and Access, click Tester under sandbox.


1 Answers

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

like image 77
awaik Avatar answered Sep 25 '22 21:09

awaik