Viktor
Viktor

Reputation: 1225

SwiftyStoreKit. How to verify subscription without entering a password?

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:

Upvotes: 2

Views: 2692

Answers (1)

MarkZ
MarkZ

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

Related Questions