Reputation: 1225
I'm using SwiftyStoreKit in my application. I also have an auto-renewable subscription
, of which the purchase works correctly.
The auto-renewable subscription
is bought and when a user launches the app, it verifies the subscription using verifyReceipt
. Often when checking, a popup appears asking for the user's Apple ID and password. This behavior is rather unwanted.
If a cancels the Apple ID login or authenticates with incorrect credentials, verification throws error Cannot connect to iTunes Store
, and the user is subsequently unable to use the app.
My questions:
How can I disable the Apple ID authentication when verifying using verifyReceipt
?
In SwiftyStoreKit
, this is not yet implemented.
How can we do the verification of the subscription offline without connection to the server but using SwiftyStoreKit
? Is there a library that can do this and is easy to connect to?
Upvotes: 2
Views: 2692
Reputation: 47
I had the same issue to verify a non expired subscription. The answer is that if you need to refresh user receipt, the user need to be sign in iTunes account to fetch the receipt. Most case user are already login in with their App Store account. More discussion on this issue can be found here, might be a sandbox bug from apple:
https://github.com/bizz84/SwiftyStoreKit/issues/307 https://github.com/bizz84/SwiftyStoreKit/issues/220
Remember to set the forceRefresh to false in the func:
SwiftyStoreKit.verifyReceipt(using: appleValidator, forceRefresh: false)
Upvotes: 1