Closed nicolobozzato closed 4 years ago
It seems I found a way to fix it by removing some line from Info.plist I just left in the array
<string>fbapi</string>
that means I deleted:
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
Now my Info.plist only look like this in LSApplicationQueriesSchemes This seems to remove the possibility to the Ios to look for the app.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
</array>
[...]
@nicolobozzato Thanks, This solve my problem. But this one is only login with webview. How about native app login ? Do you have any idea ?
[Edited] I got issue at logout. I can't logout and can't change to another account to login. Any idea ?
@thetpaingsoe actually I'm not sure native app login is supported by Ios SDK. In their changelog https://github.com/facebook/facebook-ios-sdk/blob/master/CHANGELOG.md?fbclid=IwAR0mRgOwk-aNVPmWzfWxJKhgXa6vaY4vxaYPkllY5nlB4it6JWLuspD4iW0
I found in the version 6.0 changelog
LoginKit
FBSDKLoginBehavior Login flows no longer support logging in through the native application. This change reflects that.
Regarding your problem with logout, if I understand your issue, I think it depends by the cookies of Safari. So you log out from your app, but everytime you log in in the app it goes with a webview on Safari and retrieve the previous data. So only method to log out from facebook is to logOut in Safari. I'm not sure is possible to manipulate the cookies of Safari from the app IMHO.
For anyone facing this issue, I was stuck on this for 3 days and the only file that you need to check in case of infinite loop login is AppDelegate.m. I had issues because I was using multiple social auths and also deep linking. Here's what fixed in my case. If you are using google login or any other social auths add an if condition for them too.
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options]) {
return YES;
}
if ([RNGoogleSignin application:application openURL:url options:options]) {
return YES;
}
if ([RCTLinkingManager application:application openURL:url options:options]) {
return YES;
}
return NO;
}
I'm using flutter_facebook_login: ^3.0.0. A weird thing happen when trying to log in with this plugin if there is also the facebook app installed on an Ios phone. I keep bouncing between webview and app.
The webview is the first to open and asking you to log in with the Facebook app. When you click on the button to open the app, it advises you that you already logged in the flutter app with facebook. But when you press "Continue" it bounces you back to the webview. And the cycle repeats again.
If you press "cancel" at any point it goes out of the loop with status cancelledByUser. I tried to change facebookSignIn.loginBehavior but as written in the comment update login behavior is now ignored on iOS, as it's not supported by the iOS Facebook Login SDK anymore. How could I force eventually the Ios to use only web view?
The login has no problem when no app is installed on the phone.
Flutter doctor
No error are shown