You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[in_app_purchase] Implementation of the app facing package (flutter#3877)
* Start with app-facing package
* Update to pub version of platform interface
* Update CHANGELOG with feedback from PR
* Fix some spelling mistakes
* Update CHANGELOG with feedback from PR
* Update README with new features
* Update dependencies and links in documentation
* Remove iOS test from example project
* Remove test target from Podfile
* Remove test from Xcode scheme
Copy file name to clipboardExpand all lines: packages/in_app_purchase/in_app_purchase/CHANGELOG.md
+32
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,35 @@
1
+
## 0.6.0
2
+
3
+
As part of implementing federated architecture and making the interface compatible for other platforms this version contains the following **breaking changes**:
4
+
5
+
* Changes to the platform agnostic interface:
6
+
* If you used `InAppPurchaseConnection.instance` to access generic In App Purchase APIs, please use `InAppPurchase.instance` instead;
7
+
* The `InAppPurchaseConnection.purchaseUpdatedStream` has been renamed to `InAppPurchase.purchaseStream`;
8
+
* The `InAppPurchaseConnection.queryPastPurchases` method has been removed. Instead, you should use `InAppPurchase.restorePurchases`. This method emits each restored purchase on the `InAppPurchase.purchaseStream`, the `PurchaseDetails` object will be marked with a `status` of `PurchaseStatus.restored`;
9
+
* The `InAppPurchase.completePurchase` method no longer returns an instance `BillingWrapperResult` class (which was Android specific). Instead it will return a completed `Future` if the method executed successfully, in case of errors it will complete with an `InAppPurchaseException` describing the error.
10
+
* Android specific changes:
11
+
* The Android specific `InAppPurchaseConnection.consumePurchase` and `InAppPurchaseConnection.enablePendingPurchases` methods have been removed from the platform agnostic interface and moved to the Android specific `InAppPurchaseAndroidPlatformAddition` class:
12
+
*`InAppPurchaseAndroidPlatformAddition.enablePendingPurchases` is a static method that should be called when initializing your App. Access the method like this: `InAppPurchaseAndroidPlatformAddition.enablePendingPurchases()` (make sure to add the following import: `import 'package:in_app_purchase_android/in_app_purchase_android.dart';`);
13
+
* To use the `InAppPurchaseAndroidPlatformAddition.consumePurchase` method, acquire an instance using the `InAppPurchase.getPlatformAddition` method. For example:
14
+
```dart
15
+
// Acquire the InAppPurchaseAndroidPlatformAddition instance.
* The [billing_client_wrappers](https://pub.dev/documentation/in_app_purchase_android/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';`;
21
+
* iOS specific changes:
22
+
* The iOS specific methods `InAppPurchaseConnection.presentCodeRedemptionSheet` and `InAppPurchaseConnection.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 the `InAppPurchase.getPlatformAddition` method like so:
23
+
```dart
24
+
// Acquire the InAppPurchaseIosPlatformAddition instance.
* The [store_kit_wrappers](https://pub.dev/documentation/in_app_purchase_ios/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 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_ios/store_kit_wrappers.dart';`;
32
+
1
33
## 0.5.2
2
34
3
35
* Added `rawPrice` and `currencyCode` to the ProductDetails model.
and [billing_client_wrappers](https://pub.dev/documentation/in_app_purchase_android/latest/billing_client_wrappers/billing_client_wrappers-library.html).
49
49
These APIs expose platform-specific behavior and allow for more fine-tuned
50
50
control when needed. However, if you use one of these APIs, your
51
51
purchase-handling logic is significantly different for the different
@@ -70,13 +70,17 @@ This section has examples of code for the following tasks:
70
70
The following initialization code is required for Google Play:
71
71
72
72
```dart
73
+
// Import `in_app_purchase_android.dart` to be able to access the
@@ -262,18 +254,18 @@ codes that you've set up in App Store Connect. For more information on
262
254
redeeming offer codes, see [Implementing Offer Codes in Your App](https://developer.apple.com/documentation/storekit/in-app_purchase/subscriptions_and_offers/implementing_offer_codes_in_your_app).
Copy file name to clipboardExpand all lines: packages/in_app_purchase/in_app_purchase/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactory.java
Copy file name to clipboardExpand all lines: packages/in_app_purchase/in_app_purchase/android/src/main/java/io/flutter/plugins/inapppurchase/BillingClientFactoryImpl.java
0 commit comments