bizz84 / bizz84/SwiftyStoreKit

Unknown error. Please contact support

Open
#677 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Swift
Stars
6.7k
Forks
801
PR merge metrics
No merged PRs in 30d

Description

## Bug Report
"Unknown error. Please contact support"
Anyone solve this?

````swift
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")
}
}
}
````

* https://github.com/bizz84/SwiftyStoreKit/issues/305#issuecomment-370218032
* https://github.com/bizz84/SwiftyStoreKit/issues/305#issuecomment-431040349
* https://github.com/bizz84/SwiftyStoreKit/issues/376#issuecomment-407530555
* https://github.com/bizz84/SwiftyStoreKit/issues/653#issuecomment-983745388

**To Reproduce**
User feedback

**Expected behavior**
Unknown error. Please contact support

## Platform Information
- OS: macOS 10.14.3
- Purchase Type: consumable
- Environment: production
- SwiftyStoreKit version: 0.16.4

**Screenshots**
![image](https://user-images.githubusercontent.com/1049575/170472848-2f1c3083-f9ed-4b70-a57b-86783460dbe1.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.