I\'ve updated to Xcode 7 and the latest iOS SDK. I\'ve added the appropriate entries in my app\'s plist:
My app\'s Facebook login works fine on device. Howe
For iOS 9 or above, add this method in your AppDelegate file:
https://stackoverflow.com/a/43515243/535013
According to Facebook:
iOS SDK supports SafariViewController which lets us switch show web-rendered dialogs instead of doing an app-switch. This beta SDK will automatically determine the best app switch experience for people based on their device. For example, defaulting the person's experience through SafariViewController instead of Safari for Facebook Login....
Facebook reference link: https://developers.facebook.com/bugs/786729821439894/?search_id
Stack ref link: https://stackoverflow.com/a/32593070/2905967
This is an Xcode warning indicating the the canOpenURL: call returned false. As long as you have configured the
LSApplicationQueriesSchemesentry in your plist as described above, you can ignore this warning.
This is not a problem. The FB SDK is trying to open the native facebook app which has the fbauth2:// url type. In Simulator its not available, so its just putting a log that it could not open the native Facebook app. You can configure the Facebook acct in Simulator and then tell the FB Login button to use the native Facebook account instead of opening the web view. But Facebook contends that millions of people use Facebook in browser and so in iOS 9 they have used the new SFSafariViewController as the default behaviour for facebook logins even on devices. You can try to use the native Facebook and see if it works.
Check this link for the discussion.
https://www.facebook.com/login.php?next=https%3A%2F%2Fdevelopers.facebook.com%2Fbugs%2F786729821439894%2F%3Fsearch_id
By following these steps, you may be able to avoid this error:
1) go to -> Supporting File
2) info.plist
3) Right click on info.plist -> Open As -> Select Source Code
* Add code below inside <dict>...</dict> *
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
After you have updated your App's .plist file with the LSApplicationQueriesSchemes array, which you seem to have already done:
Next, verify that your Facebook SDK is version 4.6.0. Follow the Facebook directions if it's not.
Lastly, which is probably where the problem arises, is to Reset your Simulator's content and settings
Apple's Simulator, even the IDE, will have bugs and closing and reopening, along with reseting the simulator, are always something to consider early on in your search for a solution.
Hope this helps!