Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've updated to Xcode 7 and the latest iOS SDK. I've added the appropriate entries in my app's plist:

enter image description here

My app's Facebook login works fine on device. However, on iOS 9 simulator, I'm getting:

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

And login is not working. I've seen facebook login issue - canOpenURL: failed for URL: "fbauth2:///" - error: "(null)" but I have FBSDKCoreKit framework. I've also seen Facebook SDK 4.5 IOS 9 but it's answer doesn't solve my problem.

Why am I getting this error on simulator and not on device even though I've done the checklist at https://developers.facebook.com/docs/ios/ios9?

like image 304
Can Poyrazoğlu Avatar asked Sep 20 '15 06:09

Can Poyrazoğlu


2 Answers

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.

like image 68
SoftDesigner Avatar answered Sep 22 '22 22:09

SoftDesigner


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

like image 35
Pradeep K Avatar answered Sep 20 '22 22:09

Pradeep K