Unable to access Apple hosted In App Purchase downloads in iOS 8 beta 3

Originator:josh64
Number:rdar://17604873 Date Originated:9/7/2014
Status:Closed Resolved:
Product:iOS SDK Product Version:iOS 8 beta 3
Classification:serious bug Reproducible:always
 
Summary:
When paymentQueue:updatedDownloads: is called at the end of a download and for the download SKDownload *d
d.downloadState == SKDownloadStateFinished  

The downloaded content is available at d.contentURL.path (at least in <contentURL.path>/Contents)
 
In ios7.x you can enumerate the files contentURL.path and <contentURL.path>/Contents, with:
 
    NSArray *contentsDirectoryFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:productPath error:&error];
 
In iOS 8 beta (1, 2, and 3) I'm getting Cocoa error 257 = NSFileReadNoPermissionError for contentsOfDirectoryAtPath. Also tried enumeratorAtPath and that returns an enumerator with  a count of 0. subpathsOfDirectoryAtPath also returns a 257 error.
 
[[NSFileManager defaultManager] fileExistsAtPath:productPath isDirectory:&isDir] returns YES and isDir is YES
 
File attributes seem sensible. NSFilePosixPermissions of 0755 should allow the directory to be read.

The same code works fine on an iOS 7.1 device.

Steps to Reproduce:
1. Set up an app with StoreKit to download apple-hosted In App Purchase.
2. Use the generic (including the Apple-provided example) code to try to access the files at SKDownload.contentURL when SKDownload.downloadState == SKDownloadStateFinished

Expected Results:
Expected to be able to enumerate the files at SKDownload.contentURL and copy them to a usable location for the App.

Actual Results:
Actual results are Cocoa error 257 = NSFileReadNoPermissionError for contentsOfDirectoryAtPath. No files references are returned.


Configuration:
iPad mini retina 32gb wifi

Comments

Closed as a duplicate of 17260330 by Apple


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!