facebook login issue - canOpenURL: failed for URL: “fbauth2:///” - error: “(null)”

前端 未结 9 818
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 18:13

When I click on login with Facebook button, it is opening safari browser and getting closed immediately. Noticed error on the console.

App delegate method:



        
相关标签:
9条回答
  • 2020-12-08 18:49

    The issue is due to App Transport Security introduced in iOS 9.

    There are two solutions, both deal with fixing your info.plist file

    Here's a guide http://discoverpioneer.com/blog/2015/09/18/updating-facebook-integration-for-ios-9/

    0 讨论(0)
  • 2020-12-08 18:54

    The "-canOpenURL: failed for URL" warning is a red herring and simply means the FB app is not installed on the device/simulator you're running on.

    It looks like you're requesting an invalid scope (aka permission) of "Public". Can you include your code that includes what permissions you are asking? public_profile is probably what you want (and what the SDK defaults to if none are provided).

    More importantly, do NOT add fbauth2 to your CFBundleURLSchemes as that will break login flows. As Himanshu pointed out, those entries should be entered under LSApplicationQueriesSchemes in our plist.

    0 讨论(0)
  • 2020-12-08 19:02

    You have an extra "/" in your url "fbauth2:///".

    Then you can see "error_message=Invalid+Scope" in the url, you should probably check the permissions of your app: https://developers.facebook.com/docs/facebook-login/permissions/v2.4

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