diff --git a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md index f4479ad2329c..f12c73a14747 100644 --- a/packages/in_app_purchase/in_app_purchase/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.41/Dart 3.11. +* Fixes the `completePurchase` docs, which referred to a `PurchaseException` type that does not exist. ## 3.3.1 diff --git a/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart b/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart index 3278d3f9c12f..3e8d846d34a6 100644 --- a/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart +++ b/packages/in_app_purchase/in_app_purchase/lib/in_app_purchase.dart @@ -176,15 +176,13 @@ class InAppPurchase implements InAppPurchasePlatformAdditionProvider { /// 2. Any subsequent attempts to buy the same product ID will fail with a purchase /// error indicating a duplicate transaction is pending. /// - /// The method will throw a [PurchaseException] when the purchase could not be - /// finished. Depending on the [PurchaseException.errorCode] the developer - /// should try to complete the purchase via this method again, or retry the - /// [completePurchase] method at a later time. If the - /// [PurchaseException.errorCode] indicates you should not retry there might - /// be some issue with the app's code or the configuration of the app in the - /// respective store. The developer is responsible to fix this issue. The - /// [PurchaseException.message] field might provide more information on what - /// went wrong. + /// There is no shared exception type for a failed [completePurchase] call, so + /// errors are platform specific. On Android a failed acknowledgement is not + /// thrown, so the returned `Future` still completes normally. To read + /// the result, call `completePurchase` on `InAppPurchaseAndroidPlatform` from + /// `in_app_purchase_android` directly, which returns a `BillingResultWrapper` + /// whose `responseCode` reports the failure. On iOS and macOS a failure + /// reported by StoreKit is thrown as a `PlatformException`. Future completePurchase(PurchaseDetails purchase) => InAppPurchasePlatform.instance.completePurchase(purchase); diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md index 64b57eeb67d3..b8b6b483ab42 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.41/Dart 3.11. +* Fixes the `completePurchase` docs, which referred to a `PurchaseException` type that does not exist. ## 1.4.1 diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_platform.dart b/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_platform.dart index 88ab488387f2..2c0e660d230b 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_platform.dart @@ -166,15 +166,13 @@ abstract class InAppPurchasePlatform extends PlatformInterface { /// > On Android, If you do not call [completePurchase] for a transaction on Android, Google Play /// > will automatically refund and revoke the purchase after 3 days. /// - /// The method will throw a [PurchaseException] when the purchase could not be - /// finished. Depending on the [PurchaseException.errorCode] the developer - /// should try to complete the purchase via this method again, or retry the - /// [completePurchase] method at a later time. If the - /// [PurchaseException.errorCode] indicates you should not retry there might - /// be some issue with the app's code or the configuration of the app in the - /// respective store. The developer is responsible to fix this issue. The - /// [PurchaseException.message] field might provide more information on what - /// went wrong. + /// There is no shared exception type for a failed [completePurchase] call, so + /// errors are platform specific. On Android a failed acknowledgement is not + /// thrown, so the returned `Future` still completes normally. To read + /// the result, call `completePurchase` on `InAppPurchaseAndroidPlatform` from + /// `in_app_purchase_android` directly, which returns a `BillingResultWrapper` + /// whose `responseCode` reports the failure. On iOS and macOS a failure + /// reported by StoreKit is thrown as a `PlatformException`. Future completePurchase(PurchaseDetails purchase) => throw UnimplementedError('completePurchase() has not been implemented.');