Posts

Post not yet marked as solved
4 Replies
1.8k Views
Hello, I have an existing app which is beeing sold in the app store since 2010. Now I want to convert this app into a free app with optional in-app purchases. A part of the functionality which paid users currently have should then be accessible only by IAP. Therefore, I must identify my existing customers, to not make them pay again for functionality they have paid already. Googling around reveals that this is not easy to do, if it was possible at all. However, I found this post: https://stackoverflow.com/questions/3735635/convert-existing-ios-paid-app-to-freemium-model-with-in-app-purchase Quote: "There is now an Apple-approved way to do this on both iOS and macOS. The originally downloaded version of the app can be obtained from the receipt using the info key Original Purchased Version. You can then decide whether to unlock features if that version predates the switch to IAP." Now I have played around with this a bit, or more precisely: NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; NSData *receipt = [NSData dataWithContentsOfURL:receiptURL]; However, in my tests, receipt will always be nil. The URL also points to some local location with sandbox in the name. Am I doing something wrong in general, or is this just not supposed to work how I thought it would? Note that I have installed my app from the app store on my device, then launched the above code on my device (so I'm NOT testing this in the simulator). I also read about SKReceiptRefreshRequest, however I cant figure out how to use it. So the question is, how would I figure out if a user has already purchased the orignal paid version? My app does not have a server-component, and by checking some NSUserDefaults key would result in charging users which reinstall the app on a new device. So what should I do?
Posted
by s710.
Last updated
.
Post not yet marked as solved
2 Replies
2.4k Views
I am working on an App which is capable of opening Wallet passes (.pkpass files). While I can now open most of my testing passes (used/expired boarding passes / tickets / etc. I found in my mails), one specific pass fails to open: My subway card. It is rather old; I have it in the wallet for quite some time now. When I uncompress the .pkpass file (exported from the Wallet), I will get a JSON file which cannot be opened properly. If I do e.g. less pass.json, this is what I see: If I open the same file in XCode, this is what I see: Interestingly, when I open the file using the quick preview in Finder (space), or open file properties in Finder, I will get a valid and clean preview as well. Also, the pass was exported from my iOS wallet, so the file must be valid. This leads me to believe that this file is using some kind of encoding which cannot be displayed correctly in e.g. less. I tried opening the file using BBedit, but no matter which encoding I pick, I will always get garbage. Can anyone tell me which kind of encoding/file format this is, so I can implement a proper method of opening/parsing this?
Posted
by s710.
Last updated
.