gpt4 book ai didi

iphone - iPhone 中的 Dropbox 下载问题

转载 作者:可可西里 更新时间:2023-11-01 06:23:38 26 4
gpt4 key购买 nike

您好,我在我的应用程序中使用 Dropbox API。我想从我的保管箱帐户下载图像并将它们存储在模拟器或设备目录中。我使用 Full DropBox Access 在 Dropbox 中创建了应用程序。但它给了我这个错误:

[WARNING] DropboxSDK: error making request to /1/files/sandbox/Photos - App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead?

这是我的代码

restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
restClient.delegate = self;
NSString *fileName = [NSString stringWithFormat:@"/avatar.jpg"];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];

NSString* path2 = [documentsDirectory stringByAppendingString:
[NSString stringWithFormat:@"%@", fileName]];

[restClient loadFile:fileName intoPath:path2];

最佳答案

设置 Dropbox session 时,必须设置正确的根:

DBSession* dbSession =
[[DBSession alloc]
initWithAppKey:@"APP_KEY"
appSecret:@"APP_SECRET"
root:kDBRootDropbox]; // either kDBRootAppFolder or kDBRootDropbox
[DBSession setSharedSession:dbSession];

在你的情况下,因为你使用的是完整的保管箱,你需要将根设置为 KDBRootDropbox。

关于iphone - iPhone 中的 Dropbox 下载问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11735167/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com