Amazon In-app purchase for Flutter use Amazon AppStore SDK
Follow Amazon's instructions to configure the Appstore SDK with your public key: https://developer.amazon.com/docs/in-app-purchasing/integrate-appstore-sdk.html#configure_key
Before using the plugin, you must call:
FlutterAmazonIapPlugin.instance.initialize()
As this is a wrapper around the methods exposed by the Amazon Appstore SDK, the user should read Amazon's documentation. Calls to the Appstore SDK are in the form of function calls, while the responses are delivered as events to the provided streams. https://developer.amazon.com/docs/in-app-purchasing/iap-implement-iap.html
- getUserData().
- getPurchaseUpdates().
- getProductData(List skus).
- purchase(String sku)
- notifyFulfillment(String receiptId)
- userDataResponse
FlutterAmazonIapPlugin.userDataResponse?.listen((event) {
print(event);
});
- purchaseUpdatesResponse
FlutterAmazonIapPlugin.purchaseUpdatesResponse?.listen((event) {
print(event);
});
- productResponse
FlutterAmazonIapPlugin.productResponse?.listen((event) {
print(event);
});
- purchaseResponse
FlutterAmazonIapPlugin.purchaseResponse?.listen((event) {
print(event);
})
If obfuscating the app, the following steps should be taken: https://developer.amazon.com/docs/in-app-purchasing/iap-obfuscate-the-code.html