iOS 9 Facebook login simulator -canOpenURL: failed for URL: “fbauth2:///” - error: “(null)”

前端 未结 9 2627
情话喂你
情话喂你 2020-11-27 19:38

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

相关标签:
9条回答
  • 2020-11-27 19:50

    For iOS 9 or above, add this method in your AppDelegate file:

    https://stackoverflow.com/a/43515243/535013

    0 讨论(0)
  • 2020-11-27 19:54

    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

    0 讨论(0)
  • 2020-11-27 19:59

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

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

    0 讨论(0)
  • 2020-11-27 20:02

    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

    0 讨论(0)
  • 2020-11-27 20:02

    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>
    
    0 讨论(0)
  • 2020-11-27 20:03

    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

    To Reset your Simulator:

    1. Choose Simulator
    2. Select Reset Content & Settings
    3. and the Reset option

    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!

    0 讨论(0)
提交回复
热议问题