SwiftyStoreKit: SwiftStoreKit.ReceiptError error 1
Platform
- [X ] iOS
- macOS
- tvOS
In app purchase type
- Consumable
- Non-consumable
- [X ] Auto-Renewable Subscription
- Non-Renewing Subscription
Environment
- [ X] Sandbox
- [X ] Production
Version
0.13.3
Report
Issue summary
We’re fetching the receipt in order to validate if the subscription is still valid or not. In order to do so we fetch the receipt and sent the encoded receipt to our server. This is our code:
SwiftyStoreKit.fetchReceipt(forceRefresh: false) { result in
switch result {
case .success(let receiptData):
let encryptedReceipt = receiptData.base64EncodedString(options: [])
Log.info("Fetch receipt success")
//further code to send the receipt to our server
case .error(let error):
observer.send(error: error.localizedDescription)
}
}
Everything works on my side but unfortunately the Apple reviewer gets the error which is shown in the section below. So error.localizedDescription
is the alert message. Now I looked through the errors from SwiftStoreKit and I’m a bit hopeless cause I couldn’t find any error with code 1. Could someone help me here?
What did you expect to happen
Fetching receipt is successfull and the receipt will be send to our sever for validation without error
What happened instead
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 1
- Comments: 32
I don’t do anything special. I just run this check and handle things accordingly.
Ahh ok. Then I would recommend if you wanna quick fix for now, you can use this TPInApp receipt. As this library does not require the URL, and takes itself. Btw after using this lib, my app has been accepted. I’ll attach the code snippet below!
I’ve used TPInAppReceipt Not a popular one, but works for now.