Open lmordell opened 4 years ago
I am also experiencing this issue on iOS 13 devices only.If you want to minimize the number of users you annoy, you can detect device iOS version with the device_info package:
// TODO: remove this when issue fixed so IOS 13 users can login through the native facebook app
// https://github.com/roughike/flutter_facebook_login/issues/195
if (Platform.isIOS){
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
String iosSystemVersion = iosInfo.systemVersion;
if (iosSystemVersion.startsWith('13')){
print('Running on IOS version $iosSystemVersion. Forcing facebook login to be webViewOnly');
_facebookSignIn.loginBehavior = FacebookLoginBehavior.webViewOnly;
}
}
Me too. Thanks, @Imordell ! that fixed it for me. Hours wasted on that before I got your answer
@lmordell Thanks for
facebookLogin.loginBehavior = Platform.isIOS ? FacebookLoginBehavior.webViewOnly : FacebookLoginBehavior.nativeWithFallback;
Thanks, @Imordell !
I am doing this as well and just received an email from Facebook saying I am in violation of one of their policies.
I have until 10-31 to correct the issue or my app will face "enforcement".
https://developers.facebook.com/policy#7-2-photo
Android apps should use the default login behavior defined by the SDK, which may use the web-view Login dialog. On iOS, only kiosk apps may use a web-view Login dialog.
I found a working solution by add some extra code to AppDelegate.swift
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if url.scheme == "fbXXXXXXXXX" {
return ApplicationDelegate.shared.application(app, open: url, options: options)
}
.....
}
Relace XXXXXXXXX with your facebook ID
I'm using version 2.0.1 of flutter_facebook_login.
When I attempt to perform a facebook login on iOS, the modal never appears and the result status is 'FacebookLoginStatus.cancelledByUser'. This issue does not occur on Android.
As a workaround, I conditionally set the FacebookLoginBehavior to 'webViewOnly' for iOS. With this behavior, I can see the Facebook login modal.