-
Notifications
You must be signed in to change notification settings - Fork 796
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
SwiftStoreKit.ReceiptError error 1 #392
Comments
Would like to know also. |
This error appears when on a fresh install of the app with no receipt at all, you're trying to get that receipt, either from the iPhone or from the Apple servers, where there's no receipt as well, because you never bought anything. Make sure you handle this error. |
I also have this issue. But I have it when I fetch receipt after successful purchase. |
Same here. Apple reviewer has such an error after successful subscription. What can be wrong? |
this issue still exists in release 0.15.0 |
in my case I got this error when :
result received : error.localizedDescription |
I too have this issue, occurs when I try to verify receipt. Although it's fine for Me, only apple reviewer gets this each time. Does someone know what could be wrong or is this related to submitting our subscription. In appStoreConnect, my subscription is still showing "waiting for review". SwiftyStoreKit.verifyReceipt(using: appleValidator) { result in |
Same here in 0.16.0. Everything works fine on my device. But Apple rejected the build and sent the error screenshot. |
Do you know any alternative? Until these guys fix this? |
Not found alternative solution yet. |
Please let me know if you did.
…On Tue, 7 Jul 2020 at 14:20, cclaflin89 ***@***.***> wrote:
Not found alternative solution yet.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#392 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGIO2I6TKMSA5FIDF7CHYC3R2LOVJANCNFSM4FNPZNOQ>
.
|
I have also encountered this problem, but have been unable to find a solution, I hope to get help, thank you! |
My app got rejected with the same error. Update:
#if DEBUG
AppleReceiptValidator(service: .sandbox, sharedSecret: secret)
#else
AppleReceiptValidator(service: .production, sharedSecret: secret)
#endif
Update 2: Ignore my previous update. I found the real cause for the issue. See below. |
I have used a different library to verify receipt, and for other operations such as purchase, I've used SSK. My app is live! |
Do you verify the receipts locally? What's the library you used? |
I've used TPInAppReceipt |
Thanks :) btw I discovered something just now regarding this whilesifting through Apple docs. See my comment above. I updated it. |
Oh Cool! I've always given .production, will this "if else", fix it? |
No, my code is what's causing the issue, I think. The if block runs while I'm in development, the if else block runs when the app is released. The problem is Apple requires us to still call the sandbox URL while the app is in review. Even though the app is technically a release build so it calls the production URL. This might be what's giving the error. |
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! |
Thank you. I'll give this approach a try 👍🏼 |
By the way, is local receipt validation ideal for auto-renewable subscriptions? Because I need to get the latest data like the expiration date. Do I have to refresh the receipt at every launch to get the most updated one? |
Mine is a social media app, I refresh receipt before user uses a premium feature, every time. Not sure about your use-case, but should be fine. |
I got this issue fixed! @Starsky89 is correct. This error occurs when you're trying to refresh a receipt that does not exist. This seems to be the underlaying StoreKit error. It doesn't tell much but upon further searching I came across this thread which confirmed the suspicion. I changed my code to first check whether the receipt exist or not and then fire the verification code. My app got approved. |
Great! Can you provide code snippet/SC of your function. |
I don't do anything special. I just run this check and handle things accordingly. if SwiftyStoreKit.localReceiptData != nil {
// Has a receipt. Verify it.
let validator = AppleReceiptValidator(service: .production, sharedSecret: Constant.Secret.inAppPurchase)
SwiftyStoreKit.verifyReceipt(using: validator) { result in
switch result {
case .success(let receipt):
// handle success
case .error(let error):
// show error
}
}
} else {
// There is no receipt.
// Possibly a brand new user who has not purchased anything in the app before.
} |
The reviewers also rejected my app. In their test environment they get a "SwiftStoreKit.ReceiptError error 1" after restoring and verifying subscription purchases. In my sandbox environment, however, everything works fine. So instead of receiving an empty receipt, they get no receipt and verification fails! (Thus, other approaches like InAppReceipt.refresh will also fail). Isuru-Nanayakkara is right. You have to check if SwiftyStoreKit.localReceiptData is nil. This information should be added to the wiki. |
The App subscription works fine in the sandbox environment, but when apple reviewers test the app they got the below error after purchasing the subscription. " The operation couldn't be completed. only fetch recipt is used , I'm not using validate recipt anywhere in the code, but still I get the error. Code:-
|
@anta-semenov anta-semenov commented on 11 Jan 2019
hi Mr.anta-semenov did you find any solution |
I had the same issue when I sent app that worked in sandbox for review. Review team still had the error on its iPad. I had my own IAP manager which worked with StoreKit natively. After that I switched to SwiftyStoreKit with the hope that all common issues are fixed in the library. Seems that the error is pretty common and not obvious for devs. Code from receiptVerificator UPD: The problem is in accessing receipt at app's start on simulator after erasing its content and settings. I switched to TPInAppReceipt for receipt checks and the problem has gone. |
Also I noticed that SwiftyStoreKit returns ReceiptError.noReceiptData in case there is no receipt data after fetchReceipt, but I can't remember that reviewers have faced that error. |
not work for me. Its work in sandbox, but users without subscriptions have problem in AppStore. upd: If you check subscriptions during App started, you use bad solution. Read this #397 (comment) |
Platform
In app purchase type
Environment
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:
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
The text was updated successfully, but these errors were encountered: