Last updated:
0 purchases
flutter payments
flutter_payments #
Flutter In App Purchases For Humans.
Getting Started #
This plugin makes it easy to make products or subscriptions for both Apple App Store and Google Play.
Subscriptions #
You can use the built-in SubscriptionManager which provides a Stream interface for purchase states and abstracts away most of the logic around subscription management. However, it does not perform extended validation of a Subscription, so it may be possible to inject an invalid Subscription depending on the platform and device security settings. It is recommended that you perform server-side validation of all purchases, if that is a concern.
SubscriptionManager Example
In App Purchases (Non-subscription Products) #
You can run the included example app on an Android device to test the payment flow with test product SKUs.
Example App
FlutterPayments.billingEnabled
Determine if Billing is available on the device.
final bool billingEnabled = await FlutterPayments.billingEnabled;
copied to clipboard
FlutterPayments.getProducts
Fetch Product metadata from the store.
final List<Product> getProducts = await FlutterPayments.getProducts(
skus: <String>[
'android.test.purchased',
'android.test.canceled',
],
type: ProductType.InApp,
);
copied to clipboard
FlutterPayments.purchase
List<Purchase> purchase = await FlutterPayments.purchase(
sku: 'android.test.purchased',
type: ProductType.InApp,
);
copied to clipboard
FlutterPayments.getPurchaseHistory
Get the User's purchase history from the Store. Returns a list of Purchase instances.
final List<Purchase> purchaseHistory = await FlutterPayments.getPurchaseHistory(ProductType.InApp);
print('purchaseHistory: $purchaseHistory');
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.