(SOLVED) Verify receipt failed: networkError(error: Error Domain=SKErrorDomain Code=0 "(null)")
Platform
- [ ] iOS
- [X] macOS
- [ ] tvOS
In app purchase type
- [ ] Consumable
- [ ] Non-consumable
- [X] Auto-Renewable Subscription
- [ ] Non-Renewing Subscription
Environment
- [X] Sandbox
- [ ] Production
Version
0.15.0
Related issues
ℹ Please replace this with references to similar issues (either open or already closed).
Report
Issue summary
Verify receipt failed: networkError(error: Error Domain=SKErrorDomain Code=0 "(null)") Receipt verification failed: networkError(error: Error Domain=SKErrorDomain Code=0 "(null)")
What did you expect to happen
Unable to retrieve the app's receipt. Receipt should be retrieved.
What happened instead
Faioled with error
Verify receipt failed: networkError(error: Error Domain=SKErrorDomain Code=0 "(null)") Receipt verification failed: networkError(error: Error Domain=SKErrorDomain Code=0 "(null)")
Unable to retrieve the receipt.
I am testing this app for months. All this time I am using SwiftyStoreKit and I have been able to retrieve and verify the receipt trillions of times all these months.
Today, January 4, about 10 AM GMT, the problems start. No more receipt retrieval.
Hi, I experience this about once a day with users buying subscription. I can't figure it out either. Hundreds of others have purchased subscriptions just fine. Any suggestion how to code around this?
It's hitting the "case .error" block:
let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: x)
SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in
switch result {
case .success(let receipt):
let productId = product.productId
// Verify the purchase of a Subscription
let purchaseResult = SwiftyStoreKit.verifySubscription(
ofType: .autoRenewable, // or .nonRenewing (see below)
productId: productId,
inReceipt: receipt)
switch purchaseResult {
case .purchased(let expiryDate, let items):
self.updatePurch(action: "POST:SUCCESS:\(product.productId):\(expiryDate)")
print("Settings>> \(productId) is valid until \(expiryDate)\n\(items)\n")
UserDefaults.standard.set(expiryDate, forKey: "sub_end_dttm")
case .expired(let expiryDate, let items):
self.updatePurch(action: "POST:Expired:\(product.productId)")
print("Settings>> \(productId) is expired since \(expiryDate)\n\(items)\n")
case .notPurchased:
self.updatePurch(action: "POST:User not purchased:\(product.productId)")
print("Settings>> The user has never purchased \(productId)")
}
case .error(let error):
self.updatePurch(action: "POST:ERROR:\(product.productId):\(error)")
print("Settings>> Receipt verification failed: \(error)")
}
I am having this issue too. But I am having it on iOS (iPhone 8+ with iOS 13.3)
Same error for me with MacOS, Non-Consumable, sandbox & production have the same issue.
I had this problem before on iOS but this this time the problem was on macOS.
I have discovered how to solve this:
- on macOS: create another user on the same computer and test it from there. It will work.
- on iOS device: backup your device and reset it to factory defaults.
What is sad is that this problem will affect zillions of users out there and they will not know how to solve this and we lose sales.