Reputation: 1837
I am developing an iphone application which uploads an image to dropbox. I used the following code for image uploading.
NSData *datobj = UIImagePNGRepresentation(pic.image);
NSString *stringConvertion = [[NSString alloc] initWithData:datobj encoding:NSUTF8StringEncoding];
NSString *filename = stringConvertion;
NSString *tmpPngFile = [NSTemporaryDirectory() stringByAppendingPathComponent:@"Temp.png"];
[UIImagePNGRepresentation(pic.image) writeToFile:tmpPngFile atomically:NO];
NSString *destDir = @"/";
[[self restClient] uploadFile:filename toPath:destDir
withParentRev:nil fromPath:tmpPngFile];
But i am getting an error as follows error making request to /1/files_put/dropbox - Authentication failed How can I make authentication ?
Upvotes: 0
Views: 727
Reputation:
Add the following code in the info.plist, below the first tag
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>db-dz0h38qnvcwrzhk</string>
</array>
</dict>
</array>
Upvotes: 2