iOS 9 “fbauth2” missing from Info.plist

IosObjective C

Ios Problem Overview


FBSDKLog: fbauth2 is missing from your Info.plist under LSApplicationQueriesSchemes and is required for iOS 9.0

Any idea what this is? I have added it in my plist but did not work.

Ios Solutions


Solution 1 - Ios

You can continue to use URL schemes when you build your app for iOS 9 and you want to call URL schemes, you will now need to declare them in your apps Info.plist. There is a new key, LSApplicationQueriesSchemes, and here you will need to add the list of schemes you want to are canOpenURL on.

Try like this.

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

Solution 2 - Ios

If you are using iOS9 then this is important to update your info.plist file. You just need to do 3 steps

  1. Go to info.plist
  2. Add a field namely LSApplicationQueriesSchemes NSArray datatype.
  3. Add an item of NSString datatype name it as fbauth2.

Thats it. Just clean and run. warning wont show again.enter image description here

Solution 3 - Ios

As to v4.6.0 of the FaceBook SDK, add the following key into your plist file:

<key>LSApplicationQueriesSchemes</key>
<array>
		<string>fbapi</string>
		<string>fb-messenger-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
</array>

Link: https://developers.facebook.com/docs/ios/ios9

Solution 4 - Ios

Just follow the Facebook explanation: Preparing Your Apps for iOS9
Apple mention it in their:Privacy and Your App Keynote 2015

Solution 5 - Ios

Please just do not add this to your CFBundleURLSchemes... that will actually HIJACK any app's attempt at Facebook auth, causing a popup to show "X app wants to open " dialog...

You DO NOT want to be doing that.

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

Solution 6 - Ios

I got this when running my Kiwi tests as our test target didn't have access to main bundle. So I had to add a condition to isRegisteredCanOpenURLScheme in 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];
}

Solution 7 - Ios

To build your app for iOS 9 : ( For Facebook Share )

  1. Open Info.plist file , add another field LSApplicationQueriesSchemes under Information Property List and set it's datatype Array or NSArray .
  2. Add 3 items for LSApplicationQueriesSchemes and set their datatype to String or NSString .
  3. Assign fbauth2 , fbshareextension , fbapi as item value .

Follow this photo :

enter image description here

Solution 8 - Ios

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>

Solution 9 - Ios

You can try with below code in swift 5.0

extension Bundle {
   static let externalURLSchemes: [String] = {
      guard let urlTypes = main.infoDictionary?["LSApplicationQueriesSchemes"] 
       as? [String] else {
        return []
      }
      return urlTypes
   }()
}

You can call using Bundle

guard Bundle.externalURLSchemes.contains(URLScheme) else {
    return
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNikhila MohanView Question on Stackoverflow
Solution 1 - IosKaeyView Answer on Stackoverflow
Solution 2 - IosM SwapnilView Answer on Stackoverflow
Solution 3 - IosYizharView Answer on Stackoverflow
Solution 4 - IosMike.RView Answer on Stackoverflow
Solution 5 - Iosuser107172View Answer on Stackoverflow
Solution 6 - IosMdaGView Answer on Stackoverflow
Solution 7 - IosroyView Answer on Stackoverflow
Solution 8 - IosDeepak SakiView Answer on Stackoverflow
Solution 9 - IosSivabalaa JothiboseView Answer on Stackoverflow