Giter Club home page Giter Club logo

flutter_billing's Introduction

flutter_billing

A plugin for Flutter that enables communication with billing API in iOS and Android.

This plugin implements in app purchases rather than Android Pay or Apple Pay. Both Apple and Google collect fees upon each successful transaction made using this plugin.

Warning: This plugin is still under development, some billing features are not available yet and testing has been limited. Feedback and Pull Requests are welcome.

Using

Add flutter_billing flutter_billing as a dependency in pubspec.yaml.

Create an instance of the plugin:

final Billing billing = new Billing(onError: (e) {
  // optionally handle exception
});

Request available products for purchase:

final List<BillingProduct> products = await billing.getProducts(<String>[
    'my.product.id',
    'my.other.product.id',
]);

or

final BillingProduct product = await billing.getProduct('my.product.id');
if (product != null) {
  // success
} else {
  // something went wrong
}

Request purchased products (each purchase is a product identifier):

final Set<String> purchases = await billing.getPurchases();

Check if a product is already purchased:

final bool purchased = purchases.contains('my.product.id');

or

final bool purchases = await billing.isPurchased('my.product.id');

Purchase a product:

final bool purchased = await billing.purchase(productId);

Limitations

This is just an initial version of the plugin. There are still some limitations:

  • One time purchase products are not supported
  • Consumable products are not supported
  • Android subscription are not supported
  • iOS receipt request is not supported
  • iOS subscriptions are not supported

flutter_billing's People

Contributors

zacklore avatar alamboley avatar

Watchers

James Cloos avatar Amir Kamali avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.