我使用Xcode7将Facebook SDK升级到pod FBSDKShareKit(4.6.0)。并且按照以下方式将Facebook方案添加到白名单中。 参考:https://developers.facebook.com/docs/ios/ios9
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
然而,以下代码只能在iOS9上显示iOS默认的社交对话框。相同的代码与相同的二进制文件在iOS8上可以打开Facebook应用并正确显示共享对话框。
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.example.com"]];
content.contentDescription = @"Test";
[FBSDKShareDialog showFromViewController:self withContent:content delegate:nil];
我猜Facebook应用在iOS9上找不到,然后显示默认的社交对话框。甚至没有显示错误信息。
我错过了什么吗?还是这是iOS9的一个bug?