-
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
Synchronously load receipt without verification. #74
Comments
@joeycarmello Apologies for the late reply. As the user can make multiple purchases over a time period, you may want to always have the most up to date receipt, which is done with a call to In simple cases where for example you have only one purchase available, you could call It is beyond the scope of SwiftyStoreKit to provide a way of storing receipt data in the app. You could do it yourself with the keychain for example. |
@joeycarmello version 0.5.4 adds a Note that local receipt verification is not implemented yet. See #101 |
@joeycarmello does the addition of If this issue is not updated in the next few weeks I will close it. Local receipt verification is tracked here: #101 |
It would be nice if we could get access to this localReceiptData as a Dictionary or ReceiptInfo (just like the AppleReceiptValidator does), so we can easily retrieve the properties in the local receipt. This would solve the need to store any productIds and other properties within the app itself, as we can just read directly from the receipt file using SwiftyStoreKit. I realize this would involve dragging PKCS #7 parsing into the mix, so if not feasible in this library, one could use something like https://github.com/tikhop/TPInAppReceipt to offset this need for now. |
@RiverbayChris as I said, this can be retrieved with extension SwiftyStoreKit {
// MARK: Public methods - Receipt verification
/**
* Return receipt data from the application bundle. This is read from Bundle.main.appStoreReceiptURL
*/
public static var localReceiptData: Data?
} You can see how this is used in InAppReceipt.swift and AppleReceiptValidator.swift. Does this answer your question? |
@RiverbayChris @joeycarmello closing this for now. Feel free to reopen if my answer does not work for you. |
Right now the only way to read receipt data is by calling
verifyReceipt
, and getting access to theReceiptInfo
in theVerifyReceiptResult
.The issue is that this always make a network call out to Apple, just to read receipt data in a format that I can pass into
verifyPurchase
. This makes it impossible provide an offline-enabled app with this framework alone. I'm happy to verify the receipt with apple using this technique immediately after purchase, but there is no reason to do it every time the app is launched.Is it possible to provide an accessor to the current
ReceiptInfo
data?The text was updated successfully, but these errors were encountered: