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 agoThere are a few things to note here:
1) Did you implement the callback methods?
- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath metadata:(DBMetadata*)metadata;
- (void)restClient:(DBRestClient*)client uploadFileFailedWithError:(NSError*)error;
That's how you receive the requested information back.
2) You don't need to explicitly specify your app folder as "Apps/BirthdayScrapbook". App folder apps are implicitly rooted in their app folder, so you can just use "/".
3) Normally with the iOS or OS X Core SDK, you don't need to supply the access token manually. It's programmatically retrieved using the built-in app authorization flow, as shown in the tutorial:
https://www.dropbox.com/developers/core/start/ios
If you do have an access token you want to set manually though you can use this method on DBSession :
- (void)updateAccessToken:(NSString *)token accessTokenSecret:(NSString *)secret forUserId:(NSString *)userId;
The userId is the integer user ID for your account, e.g., as seen in DBSession.userIds , or as returned by the /account/info endpoint, which is loadAccountInfo ( loadedAccountInfo and loadAccountInfoFailedWithError callbacks) in the Core SDK.
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!