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
Bob S.15
9 years agoCollaborator | Level 9
I think part of the problem is that the documentation has not kept up with the changes -- for example, the release notes state that the browserAuth argument was dropped from authorizeFromController, but the API reference still lists it.
And the example for how to download a file shows 'setResponseBlock', but it does NOT show 'setProgressBlock'. It still says 'progress'.
This is especially important since that demo describes how to call that whole class of functions and that's the only place I have found where it is demonstrated. It's not even part of the function definitions themselves. First of all there's no easy way to find the actual function definitions. Like WHERE is the function definition for 'downloadURL'? It is such an important function, yet searching for it from the main API page doesn't reveal it. To find that function I have to look at my code, see that DBClientsManager has a member called authorizedClient, which is of type DBUserClient. Click that and then click on DBUserBaseClient when you don't see filesRoutes listed. Only then can you find that filesRoutes is of type DBFILESUserAuthRoutes, click on it and finally find the function definition for downloadURL. But even then, there is nothing on the documentation page for downloadURL which suggests that it must be called with extra arguments 'setResponseBlock' and 'setProgressBlock'! How is someone supposed to know that?!
Sorry for the rant -- but the API page could really use a search function, and those functions which require response and progress block arguments should say that.
Anyway, I got everything compiled in both of my apps and am back to square one. I've got one app which works fine, and the other one just ignores the calls to authorize the user.
Greg-DB
Dropbox Community Moderator
9 years agoThanks for pointing out the old examples! We'll get that fixed up in the documentation.
And thanks for the rest of the feedback on the documentation! It's much appreciated.
Anyway, regarding the issue of authorizeFromController not working, since it's working in your other app and the sample app, it seems like the issue must be specific to that one app. To make sure of that though, can you confirm if you tested the working apps on the same device as the not working app? Also, to eliminate other variables, do you have the same version of the SDK installed in both?
Finally, it would be helpful if we could reproduce the issue. Is the problematic app available in the US App Store for us to try?
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!