I am developing my storage provider and use Apple’s “NewBox”(it's link was expired) sample code as the host app. Ideally I hope to see I can import(copy) files from the storage provider to my NewBox's sandbox or export/move file to other apps.
At NewBox host app, when I want to import file, I use:
UIDocumentMenuViewController *vc = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[(NSString *)kUTTypeRTF,(NSString *)kUTTypePNG,(NSString *)kUTTypeText,(NSString *)kUTTypePlainText,(NSString *)kUTTypePDF, (NSString *)kUTTypeImage] inMode:UIDocumentPickerModeImport];
Once I pick up a file, in my UIDocumentPickerExtensionViewController, I invoke :
- (void)pickDocument:(NSURL *)documentURL {
[self dismissGrantingAccessToURL:documentURL];
}
After invoking dismissGrantingAccessToURL, the picker’s view will dismissed and return back to host app, and host app’s didPickDocumentAtURL will be invoked.
However, "didPickDocumentAtURL" receive the URL of the original file I selected, not the new URL that system copies to NewBox’s sandbox. This is also familiar to circumstances of export and move. Do I misunderstand the import/export/move? I thought this action about files such as copying to host app’s sandbox is done by system, and the host app will get a new URL of the file to access.
I've tried on iOS8 beta4, and this problem still exists.
Thanks!