Facebook SSO iOS does not return to application

We use Facebook SSO in our application. When you click Facebook, the application to enter the Facebook application displays the login. But after logging in, he will not return to the application. But if the user has already registered with the Facebook application, click the "Login" button to go to the Facebook application and display a dialog box with permission. When clicked, allow it to return to the application. Is this the default behavior? Or are there problems with my code or our Facebook app settings? Thanks in advance.

SHAppDelegate *appDelegate = [SHAppDelegate application]; NSArray * permissions = [[NSArray alloc]initWithObjects:FACEBBOK_PERMISSION, nil]; if (!appDelegate.session.isOpen) { appDelegate.session = [[[FBSession alloc] initWithPermissions:permissions] autorelease]; if (appDelegate.session.state == FBSessionStateCreatedTokenLoaded) { [appDelegate.session openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { [self updateView]; }]; } } if (appDelegate.session.isOpen) { [appDelegate.session closeAndClearTokenInformation]; } else { if (appDelegate.session.state != FBSessionStateCreated) { // Create a new, logged out session. appDelegate.session = [[FBSession alloc] init]; } // if the session isn't open, let open it now and present the login UX to the user [appDelegate.session openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { // and here we make sure to update our UX according to the new session state [self updateView]; }]; } 
+4
source share
1 answer

I have the same problem. This is not a .plist problem - without URLschemes (with fbXXXXX) the facebook and safari apps never return to your app. In this case, the Faccebook application is not returned only when the user has not logged into it. Safari is dealing with this situation correctly. Similarly, the Facebook application does not return control if the user has canceled permission confirmation. In other situations, everything is in order.

+1
source

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


All Articles