We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Steve M.52
10 years agoNew member | Level 1
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...
Steve M.52
10 years agoNew member | Level 1
Okay, well I'm not using openURL, I'm using [NSData dataWithContentsOfUrl:file.link] as in the original message - included here again slightly edited. Like I said, this has worked fine until now...
- (void)executeDropboxImport // THIS IS FOR TESTING ONLY - SHOULDN'T NEED IT
{
NSLog(@">>>> METHOD: executeDropboxImport <<<<<");
[[DBChooser defaultChooser] openChooserForLinkType:DBChooserLinkTypeDirect fromViewController:self completion:^(NSArray *results) {
NSLog(@">>>>> Importing after Dropbox selection");
if ([results count]) {
// we have a file
NSLog(@">>>>> Count is greater than zero, so let's import <<<<<");
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];
NSError *jsonError;
NSData *fileData = [NSData dataWithContentsOfFile:localPath];
jsonDict = [NSJSONSerialization JSONObjectWithData:fileData options:NSJSONReadingMutableContainers error:&jsonError];
if (jsonError) {
// error stuff
} else {
// do stuff with the data
}
}];
}
About 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!