Is it possible to re-access external storage device automatically after the device is disconnected and recoonected?

I'm trying to use some files within my application without transfering them to the app's file system, I've managed to do that and by using a bookmark (https://developer.apple.com/documentation/professional_video_applications/fcpxml_reference/asset/media-rep/bookmark/using_bookmark_data) I can access the same directory automatically on every new app laucnh. But if the external device gets disconnected and connected again, or the mobile device is restarted, I've noticed a change in the external device's URL and I also get an error retrieving the bookmark

Error Domain=NSFileProviderErrorDomain Code=-2001 "No valid file provider found with identifier ‘com.apple.filesystems.UserFS.FileProvider’." UserInfo={NSLocalizedDescription=No valid file provider found with identifier ‘com.apple.filesystems.UserFS.FileProvider’., NSUnderlyingError=0x302a45a40 {Error Domain=NSFileProviderErrorDomain Code=-2013 "(null)"}}

Is there a way that I can automatically regain access to the external device directory, or is using the UIDocumentPickerViewController the only way to access it again?

Thanks!

Replies

So this is iOS, right?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Add a Comment

I don’t think you can any better here. You’re already following the recommended path for storing a persistent reference, that is, using a bookmark. My advice is that you file a bug about this, making sure to explain the impact this issue has on your product.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"