-
Notifications
You must be signed in to change notification settings - Fork 335
facebook login button goes to facebook app, and then back to app without logging in #73
Comments
Have you set up the functions in your App Delegate to handle when it gets passed back? |
The issue is really simple. You have to implement the following method in your App Delegate:
And pass the URL to FBSDKApplicationDelegate. That's it. Login works as expected now What broke for some people that already implement this is that it is fairly common to only pass the fb authorize URL to the sdk delegate (as you should!) and it is common to do
but FBSDKSettings.appID() is an implicitly unwrapped optional (String!) and Swift 3 changed how they work (https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md) and the string interpolation expands it to "fbOptional(...". If this is the case, you should change it to
(you could just append another ! to FBSDKSettings.appID() but I hate this) It's not really Facebook's job what URLs is your app opening, so you should only pass it the authentication URL. |
is deprecated since iOS 9.0. @jadslim313 this is a non related question but how do you manage to open the app when pressing the facebook button? I have a custom Facebook button and every time I press it, it opens safari. |
@nico75005
FBSDKApplicationDelegate has a method that accepts the same parameters - app, url & options. Tested and it works as expected - the Safari window closes after successful login. |
Just added the function on my App Delegate, but what's the logic inside it? An example would be good to compare with my code. |
I'm not sure how to replicate the bug yet:
but once in a while when I login with the facebook button. the facebook app opens.
Usually the way it works is that it opens the facebook browser.
Anyways it opens the facebook app, and then goes back to my app without doing anything. And it just keeps doing that over and over... until I delete my app and redownload it.... is anybody else experiencing that # # # #
The text was updated successfully, but these errors were encountered: