Search code examples
iosswiftfacebook-sdk-4.x

Facebook integration authorization error using swift for iphone?


I am trying to add the login feature thru facebook sdk 4.15 .I followed the facebook sdk developer notes but i am getting error..

-canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
 canOpenURL: failed for URL: "fbauth2:/" - error: "(null)"
 Failed to get remote view controller with error: Error 
 Domain=_UIViewServiceInterfaceErrorDomain Code=0 "(null)" UserInfo=
  {OriginalError=Error Domain=FBSOpenApplicationErrorDomain Code=3 "(null)"}

Edited I have tried many times with editings. Now working fine but still with two messages

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

enter image description here

why does it happen?


Solution

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

    This means your app isn't allowed to query for the fbauth2:/. Add the fbauth2:/ in LSAPPLICATIONQUERIESSCHEMES.https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html