Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SwiftyStoreKit.purchaseProduct("reflex_remove_ads", quantity: 1, atomically: false) { result in
- switch result {
- case .success(let product):
- // fetch content from your server, then:
- if product.needsFinishTransaction {
- SwiftyStoreKit.finishTransaction(product.transaction)
- }
- print("Purchase Success: (product.productId)")
- case .error(let error):
- switch error.code {
- case .unknown: print("Unknown error. Please contact support")
- case .clientInvalid: print("Not allowed to make the payment")
- case .paymentCancelled: break
- case .paymentInvalid: print("The purchase identifier was invalid")
- case .paymentNotAllowed: print("The device is not allowed to make the payment")
- case .storeProductNotAvailable: print("The product is not available in the current storefront")
- case .cloudServicePermissionDenied: print("Access to cloud service information is not allowed")
- case .cloudServiceNetworkConnectionFailed: print("Could not connect to the network")
- case .cloudServiceRevoked: print("User has revoked permission to use this cloud service")
- }
- }
- }
Add Comment
Please, Sign In to add comment