FBSDKLog: fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0
知道这是什么吗?我把它添加到我的plist中但是没有用。
答案 0 :(得分:346)
您可以在为iOS 9构建应用程序时继续使用URL方案,并且要调用URL方案,现在需要在应用程序Info.plist中声明它们。有一个新密钥 LSApplicationQueriesSchemes ,在这里你需要添加你想要的方案列表canOpenURL。
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth2</string>
</array>
答案 1 :(得分:25)
如果您使用的是iOS9,那么更新info.plist文件非常重要。 你只需要做3个步骤 1.转到info.plist 2.添加一个字段,即 LSApplicationQueriesSchemes NSArray数据类型。 3.添加NSString数据类型名称为fbauth2。
答案 2 :(得分:20)
对于FaceBook SDK的v4.6.0,将以下密钥添加到plist文件中:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
答案 3 :(得分:14)
只需关注Facebook说明:Preparing Your Apps for iOS9
Apple在他们的Privacy and Your App Keynote 2015
答案 4 :(得分:5)
请不要将此添加到您的CFBundleURLSchemes ...这实际上会让任何应用程序尝试使用Facebook身份验证,导致弹出窗口显示&#34; X应用程序想要打开&#34;对话框...
你不想这样做。
CF:
https://developers.facebook.com/docs/applinks/ios
https://www.fireeye.com/blog/threat-research/2015/04/url_masques_on_apps.html
https://www.reddit.com/r/workflow/comments/2tlx29/get_url_scheme_of_any_app
答案 5 :(得分:2)
我在运行我的Kiwi测试时得到了这个,因为我们的测试目标无法访问主程序包。所以我必须在isRegisteredCanOpenURLScheme
FBSDKInternalUtility.m
添加一个条件
+ (BOOL)isRegisteredCanOpenURLScheme:(NSString *)urlScheme
{
static dispatch_once_t fetchBundleOnce;
static NSArray *schemes = nil;
dispatch_once(&fetchBundleOnce, ^{
schemes = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"LSApplicationQueriesSchemes"];
if (!schemes) { // This is a work around for our Kiwi tests as the Specs target doesn't have access to main bundle
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *path = [bundle pathForResource:@"Info" ofType:@"plist"];
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
schemes = [dictionary valueForKey:@"LSApplicationQueriesSchemes"];
}
});
return [schemes containsObject:urlScheme];
}
答案 6 :(得分:1)
为iOS 9构建应用程序:(对于Facebook Share)
答案 7 :(得分:0)
Write the below code in your info.plist under the **LSApplicationQueriesScheme**
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
<string>fb-messenger-platform-20150128</string>
<string>fb-messenger-platform-20150218</string>
<string>fb-messenger-platform-20150305</string>
答案 8 :(得分:0)
您可以尝试使用swift 5.0
extension Bundle {
static let externalURLSchemes: [String] = {
guard let urlTypes = main.infoDictionary?["LSApplicationQueriesSchemes"]
as? [String] else {
return []
}
return urlTypes
}()
}
您可以使用Bundle
guard Bundle.externalURLSchemes.contains(URLScheme) else {
return
}