receipt-validation

How to get the original_application_version (the first purchased version number) out of iOS Receipt in iOS 11?

帅比萌擦擦* 提交于 2019-12-01 15:45:52
问题 I have a paid iOS App. I need to get the original_application_version number (the first version purchased by the user) from the Apple AppStore Receipt. To get the receipt, when my app loads, I use checkReceiptFromAppStore() function: func checkReceiptFromAppStore() { let receipt = self.getReceipt() print("receipt Data is: \(receipt)") // prints this: receipt Data is: Optional(5141 bytes) } getReceipt() function is the following: func getReceipt() -> Data? { if Bundle.main.appStoreReceiptURL !

IOS receipt validation error 21002

喜夏-厌秋 提交于 2019-11-30 20:40:52
问题 I'm trying to use receipt validation with my server side. Everything is ok, but sometimes I see strange: 10 times validation is OK, but on 11 i get 21002 error. I dont know what to do. Sometimes I get error 21002 when I validate receipt first time after launch app. App side: func validateReceipt(productID: String) { let receipt = NSData(contentsOfURL: NSBundle.mainBundle().appStoreReceiptURL!)! let receiptdata = receipt.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))

Implementing Receipt Validation in Swift 3

大憨熊 提交于 2019-11-30 05:26:16
I am developing an iOS app in Swift 3 and trying to implement receipt validation following this tutorial: http://savvyapps.com/blog/how-setup-test-auto-renewable-subscription-ios-app . However, the tutorial seems to have been written using an earlier version of Swift, so I had to make several changes. Here is my receiptValidation() function: func receiptValidation() { let receiptPath = Bundle.main.appStoreReceiptURL?.path if FileManager.default.fileExists(atPath: receiptPath!){ var receiptData:NSData? do{ receiptData = try NSData(contentsOf: Bundle.main.appStoreReceiptURL!, options: NSData

Implementing Receipt Validation in Swift 3

不羁岁月 提交于 2019-11-28 23:30:05
问题 I am developing an iOS app in Swift 3 and trying to implement receipt validation following this tutorial: http://savvyapps.com/blog/how-setup-test-auto-renewable-subscription-ios-app. However, the tutorial seems to have been written using an earlier version of Swift, so I had to make several changes. Here is my receiptValidation() function: func receiptValidation() { let receiptPath = Bundle.main.appStoreReceiptURL?.path if FileManager.default.fileExists(atPath: receiptPath!){ var receiptData