We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Chez B.
11 years agoNew member | Level 1
How do I upload a file to my dropbox apps folder in dropbox in objective c?
Currently nothing happens when I run my code.
This is how I am setting the up client. I did not put the client set up in my viewDidLoad method because this class will never be shown it just hand...
Greg-DB
Dropbox Community Moderator
11 years agoThanks. That's correct, you don't have to call the callback methods yourself, they get called by the SDK.
Also, note that the app key passed to initWithAppKey should be just the app key, without the "db-" prefix. The "db-" prefix is only necessary for the URL scheme you register in the plist.
Finally, yes, as you mentioned this error is expected as you're just initializing an empty DBAccount object, so the userId isn't set.
Normally, you don't need to know the user ID to start with, as the user authorizes the account, and doesn't supply an access token themselves. It is possible to use API/SDK like this with a single account, but it isn't recommended, for a variety of security and technical reasons.
If you do go this route though, you'll need to get the user ID for your account once, just like you got an access token for your account once. You can do this by calling the /account/info endpoint manually once. This blog post covers how to make these calls with OAuth 1 manually if you need.
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!