We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Bob S.15
8 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.
...
- 8 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
8 years agoDropbox Staff
Hi Bob, since this was previously working for you, can you check your version control repository to see what may have changed here in your code? Or, did this stop working when you updated the version of the Dropbox SDK you're using?
In either case, is your "VC" parameter your view controller instance? Normally that's just provided as "self" (e.g., as shown in the documentation: https://github.com/dropbox/dropbox-sdk-obj-c#handling-the-authorization-flow ).
In either case, is your "VC" parameter your view controller instance? Normally that's just provided as "self" (e.g., as shown in the documentation: https://github.com/dropbox/dropbox-sdk-obj-c#handling-the-authorization-flow ).
- Bob S.158 years agoCollaborator | Level 9
Well, when I say it was working, I remember it working once, but I haven't tried it in a long time. I've been logged in so haven't really tested the login/logout stuff in a while. The Dropbox version is the same, I haven't updated it -- until just now, I thought I would try updating it to see if that fixed the problem, but it did not.
Yes, VC is the view controller, which would be 'self' if the calling object was the viewController, but in this case it is not.
I will take another look at this tomorrow, maybe it will be clearer. I think my other app is working OK, so I will try to see what the difference is with it.
Thanks,
Bob
- Greg-DB8 years agoDropbox Staff
Thanks! In that case, comparing against your other app or the DBRoulette sample app would be a good place for begin troubleshooting this, since you're not getting any error or output.
The DBRoulette sample app does use the sample authorization flow. It's available as three versions, one for each of the supported installation methods. Give that a try when you get a chance and let us know if it does or doesn't work for you.
- Bob S.158 years agoCollaborator | Level 9
Hey Greg,
In my other app, calling DropboxClientsManager authorizeFromController: works, but it opens the Dropbox app to ask for permission for the app to access its own folder. It does this even though the browserAuth argument is NO. Should it?
I may try to get the DBRoulette app to run. But my dropbox-sdk-obj-c install does not look like the one you have linked. There is no iOS folder under Examples->DBRoulette. Instead my folder looks like this confusing mess: http://imgur.com/ZtwywU0
I tried updating the dropbox SDK by calling "carthage update --platform iOS", but it did not change the structure of the Examples directory. What do I need to do for it to update to the correct Examples folder?
Thanks
Bob
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 13 minutes agoIf 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 or Facebook.
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!