8.1.2
New Features
-
External Payments Program (Android 8.3.0+, Japan Only): Support for Google Play Billing Library 8.3.0's External Payments program
- Presents a side-by-side choice between Google Play Billing and the developer's external payment option directly in the purchase flow
- New
BillingProgramAndroid.ExternalPaymentsbilling program type - New
DeveloperBillingOptionParamsAndroidto configure external payment option in purchase flow - New
DeveloperBillingLaunchModeAndroidenum for how to launch the external payment link - New
DeveloperProvidedBillingDetailsAndroidtype containingexternalTransactionTokenwhen user selects developer billing - New
developerProvidedBillingAndroidstream for listening to developer billing selection events - New
developerBillingOptionfield inRequestPurchaseAndroidPropsandRequestSubscriptionAndroidProps
// Listen for developer billing selection iap.developerProvidedBillingAndroid.listen((details) { // User selected developer billing // Report transaction to Google within 24 hours using details.externalTransactionToken print('External transaction token: ${details.externalTransactionToken}'); }); // Request purchase with external payments option await iap.requestPurchaseWithBuilder( build: (builder) { builder.google.skus = ['product_id']; builder.google.developerBillingOption = DeveloperBillingOptionParamsAndroid( billingProgram: BillingProgramAndroid.ExternalPayments, launchMode: DeveloperBillingLaunchModeAndroid.LaunchInExternalBrowserOrApp, linkUri: 'https://example.com/checkout', ); builder.type = ProductQueryType.InApp; }, ); -
New Event:
IapEvent.DeveloperProvidedBillingAndroid- Fired when user selects developer billing in External Payments flow -
enableBillingProgramAndroid in InitConnectionConfig: Enable a specific billing program during connection initialization
// Enable External Payments during connection await iap.initConnection( enableBillingProgramAndroid: BillingProgramAndroid.ExternalPayments, );This provides a cleaner alternative to calling
enableBillingProgram()separately beforeinitConnection().
Dependencies
- Updated OpenIAP versions:
openiap-gql: 1.3.8 -> 1.3.10openiap-google: 1.3.16 -> 1.3.19openiap-apple: 1.3.7 -> 1.3.8
Full Changelog: https://github.com/hyochan/flutter_inapp_purchase/compare/8.1.0...8.1.2