如何在Flutter中实施应用内购买订阅? [英] How to implement In-App Purchases Subscription in Flutter?

查看:267
本文介绍了如何在Flutter中实施应用内购买订阅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Flutter App中为iOS和Android设备提供自动续订服务.用户可以订阅1个月.

还没有一个官方维护的应用内购买插件.但是Flutter中有很多有关应用内购买的插件.

哪个是最好的?如何实施?这些安全吗?

解决方案

====从2020年3月11日起更新

您好,我可以看到仍然有人在寻找这篇文章的人Flutter中如何使用订阅的方法.在2019年我做了两个具有数千个安装的应用程序,用户可以在其中购买可再生能源在2个平台上订阅.直到2020年2月,我一直使用Flutter团队提供的软件包

(不要忘记在模拟器中登录Google Play,否则您将获得不支持应用内结算版本3")

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")

这篇关于如何在Flutter中实施应用内购买订阅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆