Flutter - Redirect user to the Subscription page in PlayStore/AppStore

Viewed 1247

I read that "Currently, the In-app Billing API does not provide support for programmatically canceling subscriptions from inside the purchasing app", I would like to redirect the user to this page to manage his own subscription.

I am using the following package in_app_purchase to implement the In-app Module.

I'm not able to find how to open the subscription page from an application in Flutter.

1 Answers

You can launch the following URL. which will redirect to the Manage Subscription page in App Store for Apple.

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

and u can launch the following URL for Android.

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

with replacing the sku and package for Android.

You will need to add url_launcher in pubspec.yaml

and import this package too,

import 'package:url_launcher/url_launcher.dart';
Related