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
Ah, sorry - you mean in the app delegate? Hmm, I see where there might be a problem here. I'm trying to discern between Dropbox and Airdrop imports so I'm now wondering if the test I'm using to determine it's Dropbox is valid:
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
sourceApplication:(NSString *)source
annotation:(id)annotation
{
BOOL handled = NO;
DLog(@"source: %@", source);
DLog(@"annotation: %@", annotation);
if ([source isEqualToString:@"com.dropbox"]) {
if ([[DBChooser defaultChooser] handleOpenURL:url]) {
// This was a Chooser response and handleOpenURL automatically ran the
// completion block
handled = YES;
}
} else {
// Otherwise treat as Airdrop
NSString *filename = [url lastPathComponent];
NSString *ext = [filename pathExtension].uppercaseString;
NSDictionary *uInfo = @{AIRDROPPED_FILE_URL_KEY:url, @"filename":filename, @"ext":ext};
NSNotificationCenter *notificationCentre = [NSNotificationCenter defaultCenter];
if ([ext isEqualToString:@"SFPZ"] || [ext isEqualToString:@"FDX"]) {
if ([self.navController visibleViewController] == self.productionsViewController) {
NSNotification *notification = [NSNotification notificationWithName:AIRDROPPED_PRODUCTION_FILE_NOTIFICATION
object:self
userInfo:uInfo];
[notificationCentre postNotification:notification];
handled = YES;
}
} else if ([ext isEqualToString:@"JSNST"] && [[self.navController visibleViewController] isMemberOfClass:[ZSShotTypeTableVC class]]) {
NSNotification *notification = [NSNotification notificationWithName:AIRDROPPED_SHOTTYPES_FILE_NOTIFICATION
object:self
userInfo:uInfo];
[notificationCentre postNotification:notification];
handled = YES;
} else if ([ext isEqualToString:@"JSNL"] && [[self.navController visibleViewController] isMemberOfClass:[ZSLensTableVC class]]) {
NSNotification *notification = [NSNotification notificationWithName:AIRDROPPED_LENS_FILE_NOTIFICATION
object:self
userInfo:uInfo];
[notificationCentre postNotification:notification];
handled = YES;
}
}
return handled;
}
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!