Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown error. Please contact support #677

Open
hzlzh opened this issue May 26, 2022 · 1 comment
Open

Unknown error. Please contact support #677

hzlzh opened this issue May 26, 2022 · 1 comment

Comments

@hzlzh
Copy link

hzlzh commented May 26, 2022

Bug Report

"Unknown error. Please contact support"
Anyone solve this?

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

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

@zhouwude
Copy link

zhouwude commented Jan 9, 2023

Did you solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants