فهرست منبع

Print localized description when a purchase fails with .unknown error

Andrea Bizzotto 8 سال پیش
والد
کامیت
21cb17ad2f
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      SwiftyStoreKit-iOS-Demo/ViewController.swift
  2. 1 1
      SwiftyStoreKit-macOS-Demo/ViewController.swift

+ 1 - 1
SwiftyStoreKit-iOS-Demo/ViewController.swift

@@ -209,7 +209,7 @@ extension ViewController {
         case .error(let error):
             print("Purchase Failed: \(error)")
             switch error.code {
-            case .unknown: return alertWithTitle("Purchase failed", message: "Unknown error. Please contact support")
+            case .unknown: return alertWithTitle("Purchase failed", message: error.localizedDescription)
             case .clientInvalid: // client is not allowed to issue the request, etc.
                 return alertWithTitle("Purchase failed", message: "Not allowed to make the payment")
             case .paymentCancelled: // user cancelled the request, etc.

+ 1 - 1
SwiftyStoreKit-macOS-Demo/ViewController.swift

@@ -200,7 +200,7 @@ extension ViewController {
         case .error(let error):
             print("Purchase Failed: \(error)")
             switch error.code {
-            case .unknown: return alertWithTitle("Purchase failed", message: "Unknown error. Please contact support")
+            case .unknown: return alertWithTitle("Purchase failed", message: error.localizedDescription)
             case .clientInvalid: // client is not allowed to issue the request, etc.
                 return alertWithTitle("Purchase failed", message: "Not allowed to make the payment")
             case .paymentCancelled: // user cancelled the request, etc.