gpt4 book ai didi

iphone - 在 iPhone 应用程序中集成 Dropbox 错误 400

转载 作者:可可西里 更新时间:2023-11-01 05:09:35 24 4
gpt4 key购买 nike

我正在使用名为 GSDropboxDemoApp 的源代码,它很好地将 Dropbox 集成到应用程序中。但是,将应用程序链接到 Dropbox 后,它会在加载文件夹内容时出错。下面是代码

我已经编辑了info.plist

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#warning Potentially incomplete method implementation. Fill in your Dropbox credentials!
#warning NB: you must also update the URL scheme listed under the CFBundleURLTypes key in GSDropboxDemoApp-Info.plist
NSString *dropboxAppKey = @"sxxxxxxxxxx";
NSString *dropboxAppSecret = @"cxxxxxxxxx";
NSString *dropboxRoot = @"kDBRootAppFolder"; // either kDBRootAppFolder or kDBRootDropbox

DBSession* dbSession = [[DBSession alloc] initWithAppKey:dropboxAppKey
appSecret:dropboxAppSecret
root:dropboxRoot];
[DBSession setSharedSession:dbSession];

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[GSViewController alloc] initWithNibName:@"GSViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
if ([[DBSession sharedSession] handleOpenURL:url]) {
if ([[DBSession sharedSession] isLinked]) {
NSLog(@"App linked to Dropbox successfully");
} else {
NSLog(@"App not linked to Dropbox!");
}
return YES;
}
return NO;
}

错误信息

 GSDropboxDemoApp[4674:907] [WARNING] DropboxSDK: error making request to /1/metadata/kDBRootAppFolder - (400) Expected a root of either 'dropbox' or 'sandbox', got 'kDBRootAppFolder'

最佳答案

你应该使用一个常量,像这样:

NSString *dropboxRoot = kDBRootAppFolder;  // either kDBRootAppFolder or kDBRootDropbox

使用常量是为了让您不必担心实际值本身。

关于iphone - 在 iPhone 应用程序中集成 Dropbox 错误 400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15208213/

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