Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Bob S.15
9 years agoCollaborator | Level 9
DropboxClientsManager authorizeFromController not doing anything
Hello,
I'm having trouble presenting the Dropbox login to the user. I had it working some time ago, but today I tried it and nothing happens. I make this call and nothing happens.
...
- 9 years ago
Hey Greg,
Finally found it. I was skipping the call to DBClientsManager setupWithAppKey! It was in there, but I was mistakenly skipping it when my app had stored the preference that Dropbox was disconnected. It's weird that that produces no error messages. I found the problem by stepping in the debugger into authorizeFromController and noticing that both my sharedApplication and controller arguments were 'nil', even though they were valid values when I passed them. Then I noticed the assert in that function:
NSAssert([DBOAuthManager sharedOAuthManager] != nil, @"Call `Dropbox.setupWithAppKey` or `Dropbox.setupWithTeamAppKey` before calling this method");As soon as I saw that, I knew what I had done.
I guess that the assert never fired, because [DBOAuthManager sharedOAuthManager] is a valid number even if you have not called setupWithAppKey?
Anyway thanks for helping me with this problem, I really appreciate it. I'll probably run into more but at least this one is down.
Bob
Greg-DB
Dropbox Community Moderator
9 years agoYou don't have to share your code if you don't want to, but for what it's worth, we won't judge your code! :-)
If the view controller setup seems unlikely to be the problem, perhaps it's something to do with the UIApplication? Is there anything unusual about your [UIApplication sharedApplication] in that app?
In any case, if it helps, the SDK is open source so you can see the definition for authorizeFromController here:
But yes, with the broken app we would also expect the official Dropbox app to get launched if it's installed. It checks if the app is installed first using canOpenUrl via the passed along UIApplication, and then opens it using openUrl, if so. It's possible it's failing somewhere there, but I've always seen output when something goes wrong with that.
Also, as another data point, have you tried it on multiple devices?
And you can programmatically check the SDK version using the kV2SDKVersion constant. Or, you can check the installed version manually in the Cartfile.resolved file. The "~>" Carthage operator is how you request a "compatible" version, so "~> 3.0.11" will give you "3.0.14", for example.
I'm not sure offhand what the expected failure mode is when attempting to use it on iOS 8, but I would expect it to crash, at least during the app authorization flow if not at launch.
Bob S.15
9 years agoCollaborator | Level 9
I see. So what would I put in the CartFile to make it download version 3.0.11, to continue supporting iOS 8?
- Greg-DB9 years ago
Dropbox Community Moderator
Based on the Cartfile documentation, it looks like the operator for that is "==", so you'd need "== 3.0.11".
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!