bizz84 / SwiftyStoreKit

Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
MIT License
6.51k stars 792 forks source link

Question: Verify Subscription Silently #390

Open haroldogtf opened 5 years ago

haroldogtf commented 5 years ago

Platform

In app purchase type

Environment

Version

0.13.3

Question

Question summary

Is possible to verify a subscription without ask the user for Itunes Password? I need this to verify if the user contains a valid Subscription every time that he open the app.

What did you expect to happen

Verify subscription without as password every time.

What happened instead

Every time that I call for the below code, the app ask for user password. But I just want to know if he subscription still valid.

let appleValidator = AppleReceiptValidator(service: .production, sharedSecret: "secret-key")
SwiftyStoreKit.verifyReceipt(using: appleValidator, completion: completion)
adelburekovic commented 5 years ago

I have the same issue. Would love to hear any suggestions.

mouness2020 commented 5 years ago

same here ... i got rejection from apple for that

ZedsDead commented 5 years ago

I would propose to add validation only after some item was purchased. This would be something like "if content unlocked then validate"

danramteke commented 5 years ago

Do you still get password prompt when you verify the receipt locally? (Without a network call)

kalamareo commented 5 years ago

Something new about this thread? I have same problem.

haroldogtf commented 5 years ago

I solved my problem as follows: When the user becomes premium I add a flag and if this flag is active I do the verification. So if he cancels, I would know. But if it has a signature and is in the app (download on another device for example) it will have to inform you that it is already subscriber to restore.

ricsantos commented 4 years ago

Can this be achieved by sending the local receipt to Apple's validator? https://developer.apple.com/documentation/storekit/in-app_purchase/validating_receipts_with_the_app_store

From my understanding, you get back the latest subscription state from this API.