func purchasePro1() {
SwiftyStoreKit.purchaseProduct(pro1ID, quantity: 1, atomically: true) { result in
switch result {
case .success(let purchase):
print("Purchase Success: \(purchase.productId)")
isPro1Purchased = true
self.delegate?.purchaseSucceed()
case .error(let error):
var errorString = ""
switch error.code {
case .unknown: errorString = "Unknown error. Please contact support"
case .clientInvalid: errorString = "Not allowed to make the payment"
case .paymentCancelled: break
case .paymentInvalid: errorString = "The purchase identifier was invalid"
case .paymentNotAllowed: errorString = "The device is not allowed to make the payment"
case .storeProductNotAvailable: errorString = "The product is not available in the current storefront"
case .cloudServicePermissionDenied: errorString = "Access to cloud service information is not allowed"
case .cloudServiceNetworkConnectionFailed: errorString = "Could not connect to the network"
case .cloudServiceRevoked: errorString = "User has revoked permission to use this cloud service"
default: errorString = (error as NSError).localizedDescription
}
self.delegate?.purchaseFailed(error: errorString)
case .deferred(purchase: _):
self.delegate?.purchaseFailed(error: "deferred")
}
}
}
Bug Report
"Unknown error. Please contact support" Anyone solve this?
To Reproduce User feedback
Expected behavior Unknown error. Please contact support
Platform Information
Screenshots