This is a simple Flutter plugin to check the status of any Google Play or AppStore subscription on client side.
WARNING: this plugin is just a proof of concept! Neither Android nor iOS docs recommend to use client-side purchase verification for different reasons. Don't use this package in your real world projects.
To initialize SubscriptionChecker
on iOS you need to provide app-specific shared secret.
final SubscriptionChecker subscriptionChecker = SubscriptionChecker()
..setSharedSecret("12ab90709c0a9798d9799e923545bb42");
final result = await subscriptionChecker.checkSubscription(subscriptionId: ["subscription_id"]);
Subscription status can be active
, expired
or notFound
in case, if subscription does not appear in purchase history.
Note, that appStoreReceiptURL
can be nil
in case, when user does not have any active subscriptions, so SubscriptionChecker
will be left uninitialized and checkSubscription
will fail with exception.