Rajeev
Rajeev

Reputation: 5002

Dropbox chooser crashing in iOS

I have integrated with dropbox chooser in iOS application. It worked till recently. Now it started crashing. Is there any change in dropbox SDK?

I could access dropbox files view in chooser and select file. But when it returns to appdelegate, it is crashing.

URL response i got : db-appkey://1/chooser?files=%7B%22link%22%3A%22https%3A%5C%2F%5C%2Fdl.dropboxusercontent.com%5C%2F1%5C%2Fview%5C%2Frsoof482pcg9d1m%5C%2FGet%2520Started%2520with%2520Dropbox.pdf%22%2C%22bytes%22%3A692088%2C%22name%22%3A%22Get%20Started%20with%20Dropbox.pdf%22%2C%22is_dir%22%3Afalse%2C%22icon%22%3A%22https%3A%5C%2F%5C%2Fwww.dropbox.com%5C%2Fstatic%5C%2Fimages%5C%2Ficons64%5C%2Fpage_white_acrobat.png%22%2C%22isDir%22%3Afalse%2C%22thumbnails%22%3A%7B%7D%7D

Code in appdelegate.m

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url sourceApplication:(NSString *)source annotation:(id)annotation
{
    if ([[DBChooser defaultChooser] handleOpenURL:url]) {
        // This was a Chooser response and handleOpenURL automatically ran the
        // completion block
        return YES;
    }
    return NO;
}

Crashing at line [[DBChooser defaultChooser] handleOpenURL:url] with below error :

2016-02-11 15:57:40.413 Backflipt[985:420495] -[__NSCFConstantString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x37768968

Check attached screenshot at exception breakpoint in Xcode enter image description here

URL response with latest dropbox chooser (version : 4.2.4) : db-8343b03llcys1pw://1/chooser?files={"link":"https://dl.dropboxusercontent.com/1/view/rsoof482pcg9d1m/Get%20Started%20with%20Dropbox.pdf","bytes":692088,"name":"Get Started with Dropbox.pdf","is_dir":false,"icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat.png","isDir":false,"thumbnails":{}}

URL response with dropbox chooser (version : 3.9) : db-8343b03llcys1pw://1/chooser?files=[{"is_dir":false,"thumbnails":{},"isDir":false,"link":"https://dl.dropboxusercontent.com/1/view/kdehqo4khfi0ifo/Getting%20Started.pdf","bytes":249159,"name":"Getting Started.pdf","icon":"https://www.dropbox.com/static/images/icons64/page_white_acrobat.png"}]

Why latest dropbox version is returning single file dictionary instead of array of files dictionary which causes parsing logic to crash.

What is the quick fix for this? writing our own parsing logic?

Upvotes: 2

Views: 269

Answers (1)

Greg
Greg

Reputation: 16940

February 10, 2016: Dropbox is aware of and working on this issue.

February 11, 2016: This should be fixed now with version 4.2.5 of the official Dropbox iOS app.

Upvotes: 1

Related Questions