-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[in_app_purchase] Implementation of the app facing package #3877
Changes from 2 commits
6310414
0c88cb7
1d8c6fd
848ab25
13da4dc
086cc8c
472d482
e2e7902
c82ecbb
c91c446
fd98524
916202c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
## 0.6.0 | ||
|
||
As part of implementing federated architecture and making the interface compatible for other platform this version contains the following **breaking changes**: | ||
|
||
* Changes to the platform agnostic interface: | ||
* The `InAppPurchaseConnection` class has been renamed to `InAppPurchase`. To access the generic InApp Purchase API use `InAppPurchase.instance`; | ||
* The `purchaseUpdatedStream` has been renamed to `purchaseStream`. Restored purchases are now also emitted on this stream and are marked with a `status` of `PurchaseStatus.restored`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have to mention "restored purchases are now also emitted on this stream and are marked with a The Also, for each API, mention its class, for example, Ditto below for all the other items. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
* The `queryPurchases` method has been renamed to `restorePurchases`. This method no longer returns a list of restored purchases but emits each restored purchase on the `purchaseStream`; | ||
* The `completePurchase` method no longer returns an instance `BillingWrapperResult` class (which was Android specific). Instead if the method ran succesfully it will simply return a completed `Future`, in case of errors it will complete the `Future` with an `InAppPurchaseException` describing the error. | ||
* Android specific changes: | ||
* The Android specific `consumePurchase` and `enablePendingPurchases` methods have been removed from the platform agnostic interface and moved into the Android specific `InAppPurchaseAndroidPlatformAddition` class: | ||
* `enablePendingPurchases` is a static method that should be called when initializing your App. Access the method like this: `InAppPurchaseAndroidPlatformAddition.enablePendingPurchases()`; | ||
* `consumePurchase` is an instance method on the `InAppPurchaseAndroidPlatformAddition` class. Acquire an instance using the `getPlatformAddition` method of the `InAppPurchase` class. For example: | ||
```dart | ||
// Acquire the InAppPurchaseAndroidPlatformAddition instance. | ||
InAppPurchaseAndroidPlatformAddition androidAddition = InAppPurchase.instance.getPlatformAddition<InAppPurchaseAndroidPlatformAddition>(); | ||
// Consume an Android purchase. | ||
BillingResultWrapper billingResult = await androidAddition.consumePurchase(purchase); | ||
``` | ||
* The [billing_client_wrappers](https://pub.dev/documentation/in_app_purchase/latest/billing_client_wrappers/billing_client_wrappers-library.html) have been moved into the [in_app_purchase_android](https://pub.dev/packages/in_app_purchase_android) package. They are still available through the [in_app_purchase](https://pub.dev/packages/in_app_purchase) plugin but to use them it is necessary to import the correct package when using them: `import 'package:in_app_purchase_android/billing_client_wrappers.dart';`; | ||
* iOS specific changes: | ||
* The iOS specific methods `presentCodeRedemptionSheet` and `refreshPurchaseVerificationData` methods have been removed from the platform agnostic interface and moved into the iOS specific `InAppPurchaseIosPlatformAddition` class. To use them acquire an instance through te `getPlatformAddition` method like so: | ||
```dart | ||
// Acquire the InAppPurchaseIosPlatformAddition instance. | ||
InAppPurchaseIosPlatformAddition iosAddition = InAppPurchase.instance.getPlatformAddition<InAppPurchaseIosPlatformAddition>(); | ||
// Present the code redemption sheet. | ||
await iosAddition.presentCodeRedemptionSheet(); | ||
// Refresh purchase verification data. | ||
PurchaseVerificationData? verificationData = await iosAddition.refreshPurchaseVerificationData(); | ||
``` | ||
* The [store_kit_wrappers](https://pub.dev/documentation/in_app_purchase/latest/store_kit_wrappers/store_kit_wrappers-library.html) have been moved into the [in_app_purchase_ios](https://pub.dev/packages/in_app_purchase_ios) package. They are still available [in_app_purchase](https://pub.dev/packages/in_app_purchase) plugin but to use them it is necessary to import the correct package when using them: `import 'package:in_app_purchase_android/billing_client_wrappers.dart';`; | ||
|
||
## 0.5.2 | ||
|
||
* Added `rawPrice` and `currencyCode` to the ProductDetails model. | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: maybe we can make this clearer such as
If you used
inAppPurchaseConnection.instance
to access generic In App Purchase APIs, please useInAppPurchase.instance
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done