We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Matt m.53
11 years agoNew member | Level 1
DBChooser and iOS 9 not returning to original app
Hi,
I had a simple implementation of DBChooser in my iPad app, and it worked fine up until the moment I upgraded my device and SDK to iOS 9.
What happens now is: 1) My app launches DBChooser (DB...
Matt m.53
11 years agoNew member | Level 1
Hi Steve,
Thanks for your reply.
Yes, I've added the dbapi schemes to my plist, and here is the code I used for my super simple test (from a completely fresh Xcode new project):
In AppDelegate.m:
-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
if ([[DBChooser defaultChooser] handleOpenURL:url])
{
NSLog(@"In openURL.");
return YES;
}
return NO;
}
And then in ViewController.m:
-(void)viewDidAppear:(BOOL)animated
{
[[DBChooser defaultChooser] openChooserForLinkType:DBChooserLinkTypeDirect fromViewController:self completion:^(NSArray *results)
{
if ([results count])
{
NSLog(@"Got file link.");
}
else
{
NSLog(@"Action canceled.");
}
}];
}
As you can see, there isn't much to it. The moment the app launches, it goes straight into DBChooser (which works), but the completion block in ViewController.m is never called, nor is openURL in AppDelegate.m, so control is never returned to my app from DBChooser.
This is on an iPad running 9.0.2. I am installing 9.1 now to see if that changes anything, but if not then I'm at a bit of a loss as to what's going on. I'd be really interested in someone else trying this test code just to see if I'm being bone-headed somewhere. I've created several apps from scratch in Xcode, and have followed the DropBox step-by-step setup over and over in an attempt to make sure I didn't miss anything. Like I said, it used to work on 8.x, and seemingly in 9.x the only change needed is to add the dbapi schemes, which I've done, hence the scratching of my head. :)
Any suggestions would be greatly appreciated.
Cheers,
Matt.
PS. I had to retype the code into this post because copy and paste didn't work very well, so if there are any typos in the source, ignore them - the code compiles and runs fine.
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!