diff --git a/src/Plugin.InAppBilling/InAppBilling.apple.cs b/src/Plugin.InAppBilling/InAppBilling.apple.cs index af41e98..bc62b02 100644 --- a/src/Plugin.InAppBilling/InAppBilling.apple.cs +++ b/src/Plugin.InAppBilling/InAppBilling.apple.cs @@ -254,7 +254,9 @@ async Task PurchaseAsync(string productId) var errorCode = tran?.Error?.Code ?? -1; var description = tran?.Error?.LocalizedDescription ?? string.Empty; var error = PurchaseError.GeneralError; - switch (errorCode) + var underlyingError = tran?.Error?.UserInfo?["NSUnderlyingError"] as NSError; + + switch (errorCode) { case (int)SKError.PaymentCancelled: error = PurchaseError.UserCancelled; @@ -269,7 +271,7 @@ async Task PurchaseAsync(string productId) error = PurchaseError.ItemUnavailable; break; case (int)SKError.Unknown: - error = PurchaseError.GeneralError; + error = underlyingError?.Code == 3038 ? PurchaseError.AppleTermsConditionsChanged : PurchaseError.GeneralError; break; case (int)SKError.ClientInvalid: error = PurchaseError.BillingUnavailable; diff --git a/src/Plugin.InAppBilling/Shared/InAppBillingExceptions.shared.cs b/src/Plugin.InAppBilling/Shared/InAppBillingExceptions.shared.cs index 209a6d5..df42ebe 100644 --- a/src/Plugin.InAppBilling/Shared/InAppBillingExceptions.shared.cs +++ b/src/Plugin.InAppBilling/Shared/InAppBillingExceptions.shared.cs @@ -69,7 +69,8 @@ public enum PurchaseError NotOwned, FeatureNotSupported, ServiceDisconnected, - ServiceTimeout + ServiceTimeout, + AppleTermsConditionsChanged } ///