Skip to content

Flutter plugin for client-side in-app purchase verification on Android and iOS

License

Notifications You must be signed in to change notification settings

ashpakouski/subscription_checker

Repository files navigation

Subscription Checker

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.

Example

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.

About

Flutter plugin for client-side in-app purchase verification on Android and iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published