Dropbox图像上传结果身份验证错误

时间:2012-09-19 09:26:22

标签: iphone objective-c ios dropbox

我正在开发一个将图像上传到Dropbox的iphone应用程序。我使用以下代码进行图片上传。

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];

但我收到的错误如下 向/ 1 / files_put / dropbox发出错误请求 - 身份验证失败 我该如何进行身份验证?

1 个答案:

答案 0 :(得分:2)

在第一个标记

下面的info.plist中添加以下代码
<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>db-dz0h38qnvcwrzhk</string>
            </array>
        </dict>
    </array>