IOS 9 Facebook login simulator -canOpenURL: failed URL: "fbauth2: ///" - error: "(null)"

I updated Xcode 7 and the latest iOS SDK. I added the relevant entries in my application:

enter image description here

My Facebook app works fine on the device. However, on the iOS 9 simulator, I get:

-canOpenURL: failed for URL: "fbauth2:///" - error: "(null)"

And the login does not work. I saw the facebook login problem - canOpenURL: failed URL: "fbauth2: ///" - error: "(null)" , but I have FBSDKCoreKit. I also saw the Facebook SDK 4.5 iOS 9 , but the answer does not solve my problem.

Why am I getting this error on the simulator and not on the device, although I made a checklist at https://developers.facebook.com/docs/ios/ios9 ?

+33
ios facebook ios9 app-transport-security facebook-ios-sdk
Sep 20 '15 at 6:04
source share
9 answers

Why do I see console messages such as "canOpenURL: failed for URL:" fb ...: // "or?

This is an Xcode warning indicating that canOpenURL: call returned false. As long as you have configured the LSApplicationQueriesSchemes entry in your plist as described above , you can ignore this warning .

+15
Nov 15 '15 at 9:46
source share

It's not a problem. The FB SDK is trying to open its own facebook application, which is of type fbauth2: // url. It is not available in Simulator, so it was simply placed by a magazine so that it could not open its own application for Facebook. You can set up Facebook acct in Simulator and then tell the FB Login button to use their own Facebook account instead of opening a web view. But Facebook claims that millions of people use Facebook in a browser, and therefore in iOS 9 they used the new SFSafariViewController as the default behavior for logging in to facebook, even on devices. You can try using your native Facebook and see if it works.

Check out this discussion link.

https://www.facebook.com/login.php?next=https%3A%2F%2Fdevelopers.facebook.com%2Fbugs%2F786729821439894%2F%3Fsearch_id

+8
02 Feb '16 at 9:34
source share

I downgraded my Facebook SDK from version 4.7 to 4.5.1 and worked fine on both Simulator and iphone device (without Facebook app).

+3
Oct. 17 '15 at 21:26
source share

After updating your App .plist file with the .plist array, which you seem to have already done:

Next , make sure your Facebook SDK is version 4.6.0 . Follow Facebook instructions if it is not.

Finally, which probably arises, is the reset contents and settings of your simulator

In Reset, your simulator:

  • Select Simulator
  • Select Reset Content and Settings
  • and reset .

Apple Simulator, even the IDE, will have errors, as well as closing and reopening, as well as restarting the simulator, will always be considered in the early stages of finding your solution.

Hope this helps!

+2
Oct 06 '15 at 2:07
source share

According to Facebook:

The iOS SDK supports SafariViewController, which allows us to switch the display of web-rendered dialogs instead of making a switch application. This beta SDK will automatically determine the best application switching experience for people based on their device. For example, a person defaults through SafariViewController instead of Safari to log into Facebook ....

Facebook Link: https://developers.facebook.com/bugs/786729821439894/?search_id

Stack link: stack overflow

+1
Sep 21 '15 at 11:52
source share

By following these steps, you can avoid this error:

1) go to β†’ Support file

2) info.plist

3) Right-click on info.plist β†’ Open as β†’ Select source code

* Add the code below inside the <dict>...</dict> *

 <key>LSApplicationQueriesSchemes</key> <array> <string>fbapi</string> <string>fb-messenger-api</string> <string>fbauth2</string> <string>fbshareextension</string> </array> 
0
Sep 22 '15 at 12:04
source share

1] Authentication in Developer.facebook and Facebook generation Id: => 460481580805052

2] Set bitcode: none of the build settings

3] Customize Plist File

 <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>fb460481580805052</string> </array> </dict> </array> <key>FacebookAppID</key> <string>460481580805052</string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>akamaihd.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>facebook.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> <key>fbcdn.net</key> <dict> <key>NSIncludesSubdomains</key> <true/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> </dict> </dict> </dict> <key>LSApplicationQueriesSchemes</key> <array> <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> </array> 

4] Download 4 Sdk Framework, for example

 =>Bolts.framework =>FBSDKCoreKit.framework =>FBSDKLoginKit.framework =>FBSDKShareKit.framework 
0
May 23 '16 at 9:52 a.m.
source share

For iOS 9 or higher, add this method to the AppDelegate file:

stack overflow

0
Apr 20 '17 at 9:18
source share

use LSApplicationQueriesSchemes or add your application id to plist.

-one
Sep 15 '16 at 8:00
source share



All Articles