Code Block NSError *theError = nil; NSBundle *mainBundle = [NSBundle mainBundle]; NSURL *appStoreReceiptURL = [mainBundle appStoreReceiptURL]; NSData *receiptData = [NSData dataWithContentsOfURL: appStoreReceiptURL options: NSDataReadingMappedAlways error: &theError]; if (!receiptData) { NSURL *receiptURL = [mainBundle URLForResource: @"receipt" withExtension: @""]; receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &theError]; }
Now it has stopped working. I have had to use both methods to get a URL to the _MASReceipt/ directory because XCode seems to do it differently when debugging. Now the application crashes the second time I try to get recieptData. Both methods return a URL with a path to @"Contents/_MASReceipt/reciept. The first time I use dataWithContentsOfURL the error and data ptr are nil. The second time the app crashes and I get a warning that the app is damaged and to download a new copy from the App Store. Looking at the build folder it appears that XCode isn't creating a _MASReceipt folder.
Do I have to put some special build instructions in the project to fix this? Why did this stop working?
Before when I couldn't get a valid receipt the program would exit and ask me to enter my test user id and password. Then it would attach a valid receipt and run the app.
I requested code level support incident from Apple Developer Support TWICE. Each time the request disappears so apparently support requests aren't really being accepted. According to my bug report there are more than ten other similar bug reports. So Apple if this is a known problem why not fix it, or at least acknowledge it?