-
Notifications
You must be signed in to change notification settings - Fork 805
Description
As recommended by Apple, local receipt validation can be performed with a number of steps:
To validate the receipt, perform the following tests, in order:
-
Locate the receipt.
If no receipt is present, validation fails. -
Verify that the receipt is properly signed by Apple.
If it is not signed by Apple, validation fails. -
Verify that the bundle identifier in the receipt matches a hard-coded constant containing the CFBundleIdentifier value you expect in the Info.plist file.
If they do not match, validation fails. -
Verify that the version identifier string in the receipt matches a hard-coded constant containing the CFBundleShortVersionString value you expect in the Info.plist file.
If they do not match, validation fails. -
Compute the hash of the GUID as described in Compute the Hash of the GUID.
If the result does not match the hash in the receipt, validation fails.
If all of the tests pass, validation passes.
A discussion on how this has been implemented by RMStore is here:
http://stackoverflow.com/questions/19943183/a-complete-solution-to-locally-validate-an-in-app-receipts-and-bundle-receipts-o
Also this series was recently published with some guidelines on how to implement local receipt validation. This links to the SwiftyLocalReceiptValidator project on GitHub, which you can already use independently of SwiftyStoreKit.
Ongoing discussion about how SwiftyStoreKit and SwiftyLocalReceiptValidator may fit together:
andrewcbancroft/SwiftyLocalReceiptValidator#1