Facebook Authentication - Problem Returning to My iPhone App via Custom URL Schema

I am trying to use the new Facebook one-time authentication process in my iPhone application.

The idea is that the application references either the Facebook application or Safari to ask the user to log in to Facebook, and then Facebook will return the user to the application using a special URL scheme.

I set up a custom URL scheme in the app by adding “fb” as described on Facebook (like “fbmyapp”). This works when entering "fbmyapp: //" in Safari - that is, my application starts. This confirms that the custom URL scheme is working.

I can successfully get the user on the Safari and Facebook application login page using the following call in the application:

facebook = [[Facebook alloc] init];
[facebook authorize:appId permissions:permissions delegate:self];

I turned on multitasking in the application (letting the application run in the background).

HOWEVER, after a successful login, Facebook should redirect back to my application, but I get from Safari, for example: "I can’t open the page - Safari cannot open the page because the address is not valid." I get a similar message in the Facebook application.

Any help would be greatly appreciated.

Thanks in advance.

+3
source share
1 answer

I think you have the wrong URL scheme. You need to add your facebook app id to fb in the app, not fb-myapp.

, .

+6

Source: https://habr.com/ru/post/1771916/


All Articles