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.
[DropboxClientsManager authorizeFromController:[UIApplication sharedApplication]
controller:VC
openURL:^(NSURL *url) {
[[UIApplication sharedApplication] openURL:url];
}
browserAuth:NO];
I've tried it with browserAuth set to YES too, and get the same problem. Has anything changed recently?
I don't see any errors or any text at all on the console. Any idea what could be the problem?
Thanks
Bob
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
36 Replies
Replies have been turned off for this discussion
- Bob S.159 years agoCollaborator | Level 9
Hey Greg,
As far as I know, there is nothing different about the project. I just added the print statements to print out the value of sharedOAuthManager. That's the standalone project you linked to earlier in this thread.
Bob
- Greg-DB9 years ago
Dropbox Community Moderator
Interesting. In that case I'll dig into it further now that I can reproduce it. Thanks! - Greg-DB9 years ago
Dropbox Community Moderator
Ok, I determined what the issue is here. Whether or not the assert occurred depended on the ENABLE_NS_ASSERTIONS build setting. By default, that build setting varies depending on which scheme you're building for. (It's Debug:Yes, Release:No.)
When using Cocoapods (as I often do when testing things) the scheme used for the Dropbox library is whatever scheme you're building your project with. While developing an app, that's typically the Debug scheme.
When using Carthage however, the Dropbox library is built when you run `carthage`, which by default uses the Release scheme. (This is configurable using Carthage's `--build` setting.)
These differences are what caused the inconsistency when trying to reproduce this across projects (since it depended on the setting/scheme/installation method.)
We're going to change this assert into a log statement so that it will happen irrespective of these conditions.
Thanks for your help and patience tracking this down! - Bob S.159 years agoCollaborator | Level 9
Ah, that makes sense. Thanks for helping me find the problem in my app!
Bob
- srinivas19958 years agoExplorer | Level 3
I'm also Getting same issue.Help to me
- Greg-DB8 years ago
Dropbox Community Moderator
srinivas1995 Please open a new thread with the specifics of the issue you're seeing so we can take a look. Thanks!
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!