Flutter - 将用户重定向到 PlayStore/AppStore 中的订阅页面

问题描述 投票:0回答:2

我读到“目前,应用内计费 API 不支持从购买应用程序内部以编程方式取消订阅”,我想将用户重定向到此页面来管理他自己的订阅。

我正在使用以下包in_app_purchase来实现应用内模块。

我无法找到如何从 Flutter 中的应用程序打开订阅页面。

android ios flutter flutter-dependencies
2个回答
14
投票

您可以启动以下 URL。这将重定向到 Apple App Store 中的

Manage Subscription
页面。

launchUrl(Uri.parse("https://apps.apple.com/account/subscriptions"));

您可以启动以下适用于 Android 的 URL。

launchUrl(Uri.parse('https://play.google.com/store/account/subscriptions?sku=pro.monthly.testsku&package=com.example.app'));

替换 Android 的

sku
package

您需要在 pubspec.yaml

 中添加 
url_launcher

并导入这个包,

import 'package:url_launcher/url_launcher.dart';

0
投票

以下是截至 2024 年 3 月的链接:

iOS(来源):

https://apps.apple.com/account/subscriptions

Android(来源):

https://play.google.com/store/account/subscriptions

© www.soinside.com 2019 - 2024. All rights reserved.