Forum Discussion

Steve M.52's avatar
Steve M.52
New member | Level 1
10 years ago

DB Chooser failing in iOS9 - app not allowed to query for scheme

I'm using DBChooser in my app. The Dropbox app is installed on the device and updated. I'm using iOS 9.3.5.

I have registered schemes dbapi-1, dbapi-2 and dbapip-3 in LSApplicationQueriesSchemes in <app>-Info.plist. I have also registered db-<my_app_key> under URL Types (obviously, with my actual app key). Aside from adding dbapi-2, this is all unchanged from the previous version of the app in which everything was working.

So, what happens now is that when I run the following code:

- (void)executeDropboxImport

{

  [[DBChooser defaultChooser] openChooserForLinkType:DBChooserLinkTypeDirect

fromViewController:self

completion:^(NSArray *results) {

    if ([results count]) {

    NSDictionary *jsonDict = nil;

    DBChooserResult *file = [results firstObject];

    NSString *ext = [file.name pathExtension].uppercaseString;

    NSString *importFile = [NSString stringWithFormat:@"ImportFile.%@", ext];

    NSString *localPath = [NSTemporaryDirectory() stringByAppendingPathComponent:importFile];

// Make a local copy of the file

    if (file.size > 0 && ([ext isEqualToString:@"JSNST"])) {

    NSData *localFileData = [NSData dataWithContentsOfURL:file.link];

    [localFileData writeToFile:localPath atomically:YES];

   // ... do stuff with the data ...

}];

}

Watching the device's console log, when this method is called I see:

Sep 17 09:03:10 Steves-iPhone5 Dropbox[1369] <Warning>: -canOpenURL: failed for URL: "dbx-carousel://" - error: "(null)"
Sep 17 09:03:10 Steves-iPhone5 Dropbox[1369] <Warning>: -canOpenURL: failed for URL: "dbx-mailbox://" - error: "(null)"
Sep 17 09:03:11 Steves-iPhone5 Dropbox[1369] <Warning>: -canOpenURL: failed for URL: "dbx-carousel://" - error: "(null)"
Sep 17 09:03:11 Steves-iPhone5 Dropbox[1369] <Warning>: -canOpenURL: failed for URL: "dbx-carousel://" - error: "(null)"

Shortly followed by:


Sep 17 09:04:14 Steves-iPhone5 Dropbox[1369] <Warning>: -canOpenURL: failed for URL: "db-<my_app_key>://1/chooser?files=%5B%7B%22link%22%3A%22https%3A%2F%2Fdl.dropboxusercontent.com%2F1%2Fview%2Fcbm3aag0sip8eiz%2FStoryFlow%2520Docs%2FStoryFlow_ShotTypes.jsnst%22%2C%22bytes%22%3A1079%2C%22name%22%3A%22StoryFlow_ShotTypes.jsnst%22%2C%22is_dir%22%3Afalse%2C%22icon%22%3A%22https%3A%2F%2Fwww.dropbox.com%2Fstatic%2Fimages%2Ficons64%2Fpage_white.png%22%2C%22isDir%22%3Afalse%2C%22thumbnails%22%3A%7B%7D%7D%5D" - error: "This app is not allowed to query for scheme db-<my_app_key>"

 

It's finding the file okay. But why is it 'not allowed to query' when I have that scheme registered?

What happens is that the import just fails silently. Like I say, the file is seen but nothing is done with it.
...

16 Replies

Replies have been turned off for this discussion

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!