Skip to content

Commit

Permalink
Merge branch 'master' into android-obfuscated
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed May 6, 2021
2 parents 5809f72 + a85ae03 commit d483ce6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Plugin.InAppBilling/InAppBilling.apple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ async Task<SKPaymentTransaction> 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;
Expand All @@ -270,7 +272,7 @@ async Task<SKPaymentTransaction> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public enum PurchaseError
NotOwned,
FeatureNotSupported,
ServiceDisconnected,
ServiceTimeout
ServiceTimeout,
AppleTermsConditionsChanged
}

/// <summary>
Expand Down

0 comments on commit d483ce6

Please sign in to comment.