This repository has been archived by the owner. It is now read-only.
No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
pplante release 0.1.5
* Fixed an error where `channel` got nuked in Swift code
* Added purchase buttons to the SubscriptionManager example page
* Added `consumeToken` for Android, still a WIP!
Latest commit 8471ca7 Jul 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea release 0.1.5 Jul 13, 2018
android release 0.1.5 Jul 13, 2018
example release 0.1.5 Jul 13, 2018
ios release 0.1.5 Jul 13, 2018
lib release 0.1.5 Jul 13, 2018
test added SubscriptionManager (extracted from RVU Insight) Jul 11, 2018
.gitignore fix gitignore Jul 11, 2018
CHANGELOG.md release 0.1.5 Jul 13, 2018
LICENSE wip: android IAP and subscriptions works. Jun 4, 2018
README.md improve docs/example app Jul 11, 2018
analysis_options.yaml fixed bugs with iOS Jul 8, 2018
pubspec.yaml release 0.1.5 Jul 13, 2018

README.md

flutter_payments

Flutter In App Purchases For Humans.

pub package

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;

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,
);

FlutterPayments.purchase

List<Purchase> purchase = await FlutterPayments.purchase(
  sku: 'android.test.purchased',
  type: ProductType.InApp,
);

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');