steprescott / SCPStoreKitManager

Block based store kit manager for In-App Purchase on iOS 7, 8 & 9 with receipt validation.
MIT License
68 stars 29 forks source link

My in-app purchases are not being restored #13

Closed rafaelmaroxa closed 9 years ago

rafaelmaroxa commented 9 years ago

Because in SCPStoreKitReceiptValidator, it uses CFBundleShortVersionString to do a early validation of the request in SCPStoreKitReceiptValidator:127.

The problem is that in SCPStoreKitReceiptValidator:176, [receipt version] returns the value of CFBundleVersion, and not CFBundleShortVersionString.

More Info: I use a post-commit hook to increment my CFBundleVersion.This conflict of version keys makes my in-app purchases not restorable. According to objc.io (http://www.objc.io/issue-17/receipt-validation.html), a new receipt issued every time an installation or update happens. Even with the post-commit hook, the bundle version in the receipt would be be updated when the app updates. Since SCPStoreKitReceiptValidator:176 is checking [receipt version] and not [receipt originalVersion], there should be no problem.