bizz84 / bizz84/SwiftyStoreKit
SwiftyStoreKit.ReceiptStatus.malformedOrMissingData
- Dominant language
- Swift
- Stars
- 6.7k
- Forks
- 801
- PR merge metrics
- No merged PRs in 30d
Description
## Question
Please explain your question in detail here.
I can't undestand whats happening. I'm on sandbox, I can't validate the receipt of a renewable subscription.
▿ 1 element
▿ 0 : 2 elements
- key : "status"
- value : 21002
```
SwiftyStoreKit.purchaseProduct(productId, completion: { result in
switch result {
case .success(let purchase):
print("Purchase Success: \(purchase.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")
default: print((error as NSError).localizedDescription)
}
}
})
let appleValidator = AppleReceiptValidator(service: .sandbox, sharedSecret: "mysecret")
SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
switch result {
case .success(let receipt):
// Verify the purchase of Consumable or NonConsumable
let purchaseResult = SwiftyStoreKit.verifySubscription(
ofType: .autoRenewable,
productId: productId,
inReceipt: receipt)
switch purchaseResult {
case .purchased(let expiryDate, let items):
print("\(productId) is valid until \(expiryDate)\n\(items)\n")
case .expired(let expiryDate, let items):
print("\(productId) is expired since \(expiryDate)\n\(items)\n")
case .notPurchased:
print("The user has never purchased \(productId)")
}
case .error(let error):
print("Receipt verification failed: \(error)")
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.