Skip to content
Branch: master
Find file History
cyanglaz [in_app_purchase] Iap refactor (#1381)
Refactor the store kit wrapper code in IAP
Latest commit e9f141b Mar 23, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
android
example
ios [in_app_purchase]retrieve receipt (#1303) Mar 6, 2019
lib [in_app_purchase] Iap refactor (#1381) Mar 22, 2019
test [in_app_purchase] refactoring and tests (#1322) Mar 8, 2019
CHANGELOG.md
LICENSE Add stub for In-app purchase plugin (#580) May 24, 2018
README.md [IAP] Update README (#1112) Jan 24, 2019
analysis_options.yaml [IAP] Generate boilerplate serializers (#1090) Jan 23, 2019
build.yaml
in_app_purchase.iml
in_app_purchase_android.iml
pubspec.yaml

README.md

In App Purchase

A Flutter plugin for in-app purchases.

Getting Started

This plugin is not ready to be used yet. Follow flutter/flutter#9591 for more updates.

There's a significant amount of setup required for testing in app purchases successfully, including registering new app IDs and store entries to use for testing in both the Play Developer Console and App Store Connect. Both Google Play and the App Store require developers to configure an app with in-app items for purchase to call their in-app-purchase APIs. You can check out the example app for an example on configuring both.

Development

This plugin uses json_serializable for the many data structs passed between the underlying platform layers and Dart. After editing any of the serialized data structs, rebuild the serializers by running flutter packages pub run build_runner build. flutter packages pub run build_runner watch will watch the filesystem for changes.

Design

The API surface is stacked into 2 main layers.

  1. in_app_purchase_connection.dart, the generic idiommatic Flutter API. This exposes the most basic IAP-related functionality. The goal is that Flutter apps should be able to use this API surface on its own for the vast majority of cases. google_play_connection.dart and app_store_connection.dart implement this for the specific platforms.

  2. The dart wrappers around the platform specific IAP APIs and their platform specific implementations of the generic interface. See store_kit_wrappers.dart and billing_client_wrappers.dart. These API surfaces should expose all the platform-specific behavior and allow for more fine-tuned control when needed.

You can’t perform that action at this time.