FBSDKLog: Cannot use the Facebook app or Safari to authorize, fb**** is not registered as a URL Scheme

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

I want to have the Facebook app native dialog login (https://developers.facebook.com/docs/technical-guides/iossdk/login/#fbnative).

In the console, I get the following message when clicking on the FBLoginView:

FBSDKLog: Cannot use the Facebook app or Safari to authorize, fb**** is not registered as a URL Scheme 

Yet I did exactly as here: Failing to open active session after updating Facebook SDK to 3.5

回答1:

In myapp-Info.plist, I renamed URL Schemes key to CFBundleURLSchemes:

Before:

CFBundleURLTypesURL Schemesfb***

After:

CFBundleURLTypesCFBundleURLSchemesfb***

The difference is not visible in XCode because CFBundleURLSchemes is aliased with URL Schemes.

As a consequence, you have to edit myapp-Info.plist manually.



回答2:

The problem is in the plist file as it needs different settings then it was published in official Facebook video and articles for Facebook SDK 3.5.x.

If you'd like to use 2 or more apps with the same Facebook AppID - which is useful as all the activity, posts will cumulate under the same Facebook appearance for all version like premium or lite - but in this case you have to solve somehow that Facebook calls back (URL scheme) the correct app from where the user came from and the user could continue to use our app when finished with the Facebook activity, like post etc.

So we have to use URL types and URL Schemes in the Xcode and in the Facebook Developer settings as you can see on the illustrations below:

UPDATE 2015

I have updated the screenshots to reflect the new Facebook and Xcode settings:

Xcode 6

As you can see you have to use the FacebookAppID with the attached URL Scheme Suffix and the same FacebookDisplayName BUT you have to use the "fb" prefix in the URL types-->URL Schemes line and use the FacebookDisplayName in the Identifier line, see below. This will ensure that Facebook will call back the correct app (lite or premium in this example) but all the post etc will go to the same Facebook app.

Facebook

iPhone Store ID is for the premium version as we'd like to route the user to the paid version!



回答3:

In my app, the error was caused because the case of the property keys was incorrect.

They should be:

URL types (lowercase T)

URL Schemes (uppercase S)



回答4:

Found the solution for us:

We had two URL schemes defined. One for our app "ourapp://" and one for facebook "fb123456789".

As it turns out, the facebook URL has to be number one.



回答5:

I fixed this issue by removing the space i had between fb and my app ID in the info.plist



回答6:

I Had the same problem (Facebook SDK 3.5.1)

My URL scheme for Facebook was on Item 1. Problem fixed by moving it to Item 0.



回答7:

Try FBConnect

you can find thorough how to here:

http://mobisoftinfotech.com/iphone-fbconnect-facebook-connect-tutorial/



回答8:

My issue was that I had the FBAppID pasted in 3x times and it was only apparent by inspecting the .plist file with a text editor.



回答9:

I have used Facebook SDK v.3 or more, I have found problem with open Facebook Login. when I click on the Login button then not open the popup screen for user Login.

So, below is the solution for this issue :

When I change the system Date & Time from previous to the current and again check the application and it's works perfect. so please check the device's Date & Time.



回答10:

I have same problem. So, i try copy item 0 : fb1234567890 to item 1 : fb1234567890

Array URL Schemes have 2 item: item 0, item 1 It's OK. hope it good for you!



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!