2015-08-14 60 views
145
FBSDKLog: fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0 

任何想法這是什麼?我已將它添加到我的plist中,但沒有奏效。iOS 9「fbauth2」從Info.plist中缺失

回答

345

當您爲iOS 9構建應用程序並且想要調用URL方案時,您可以繼續使用URL方案,現在需要在您的應用程序Info.plist中聲明它們。有一個新密鑰,LSApplicationQueriesSchemes,在這裏你需要添加你想要canOpenURL的方案列表。

Try like this.

<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>fbauth2</string> 
</array> 
+1

工作的偉大@Kaey –

+1

謝謝你,小夥子。我認爲只有在將它構建到iOS9設備時纔有必要。 – Felipe

+2

非常感謝您的解決方案!有用 ! –

25

如果使用iOS9然後更新您的Info.plist文件,這是非常重要的。 您只需要做3個步驟 1.轉到info.plist 2.添加一個字段,即LSApplicationQueriesSchemes NSArray數據類型。 3.將一個NSString數據類型名稱的項目添加爲fbauth2。

就是這樣。只需清理並運行。警告不會再顯示。 enter image description here

+0

我在Xcode 7.1下運行它,但使用運行iOS 8.1的iPhone 6 Plus模擬器。這應該不會出現應該嗎? –

2

我在運行我的新西蘭測試時得到了這個,因爲我們的測試目標沒有訪問主包。所以我不得不一個條件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]; 
} 
+0

這也適用於我。我無法得到任何其他工作。這對我來說似乎很奇怪,我們必須編輯Facebook代碼,當FB更新它們的cocopods時,它不會被擦除。 – user2285278

+0

是的,不幸的。 – MdaG

20

添加到isRegisteredCanOpenURLScheme至於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> 

鏈接:https://developers.facebook.com/docs/ios/ios9

+1

https://developers.facebook.com/docs/ios/getting-started/不會''告訴你這個,很好,你指出了! – James111

5

請不要將此添加到您的CFBundleURLSchemes中......實際上會在任何應用程序嘗試Facebook身份驗證時導致彈出窗口顯示「X應用程序想要打開」對話框...

你不想這樣做。

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 
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> 
+1

過時。較新的SDK需要更少 – LamonteCristo

1

要建立你的應用程序適用於iOS 9:(對於Facebook共享)

  1. 打開Info.plist文件,添加一個字段LSApplicationQueriesSchemes信息屬性列表並設置其數據類型ArrayNSArray
  2. 添加3個項目LSApplicationQueriesSchemes並設置其數據類型爲StringNSString
  3. 分配fbauth2,fbshareextension,fbapi作爲項目值。

按照此照片

enter image description here

相關問題