Facebook iOS SDK 4.0.1 "You must upgrade this app to Graph API v2.x"

Facebook iOS SDK 4.0.1 "You must upgrade this app to Graph API v2.x"

我正在尝试将 Facebook 应用程序从使用即将弃用的 1.0 API 升级到当前版本。我已将框架(FBSDKCoreKit、FBSDKLoginKit)替换为当前框架(4.0.1)。当我使用 web-fallback 登录时,这样做会升级应用程序。但是,当我通过 Facebook 应用程序登录时,我仍然收到弃用警告。这是我的(抽象的)代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSLog(@"SDK version: %@", [FBSDKSettings sdkVersion]); // Prints "SDK version: 4.0.1

    UIViewController *vc = [UIViewController new];

    FBSDKLoginButton *loginButton = [FBSDKLoginButton new];
    loginButton.frame = CGRectMake(10, 200, 300, 50);
    [vc.view addSubview:loginButton];

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.rootViewController = vc;
    [self.window makeKeyAndVisible];

    return YES;
}

登录时,我看到以下警告消息:

"You must upgrade this app to Graph API v2.x"

我知道这两个问题:

Facebook iOS SDK: Why am I getting "You must upgrade this app to Graph API v2.x"?

iOS - Facebook - You must upgrade this app to Graph API v2.x

None 解决了我的问题。

所以问题要么出在某些项目设置中,但他们似乎没有指定 api-version,要么出在 facebook 应用程序本身,但我找不到它。感谢任何帮助。

同样的故事。

清除整个 DerivedData (/Users/.../Library/Developer/Xcode/DerivedData) 文件夹。

帮助了 4