It's good working when safari web loggined in facebook.
but didn't login safari web and login with facebook app
throw isCancelled true.
anybody help me?
LoginManager.logInWithPermissions(["public_profile", "email"]).then(
(result) => {
if (result.isCancelled) {
Alert.alert('0. cancelled!!!!!!!!!!!!!!!!!!!');
console.log("Login cancelled");
LoginManager.logInWithPermissions(["public_profile"]).then(
(result) => {
if (result.isCancelled) {
Alert.alert('5555555. cancelled!!!!!!!!!!!!!!!!!!!');
console.log("Login cancelled");
} else {
Alert.alert('5555555. onFacebookClicked go');
getFacebookInfo()
}
},
function (error) {
Alert.alert('33333. Login fail with error->' + error.message);
console.log("Login fail with error: " + error);
}
);
} else {
Alert.alert('1. onFacebookClicked go');
getFacebookInfo()
}
},
function (error) {
Alert.alert('0. Login fail with error->' + error.message);
console.log("Login fail with error: " + error);
LoginManager.logInWithPermissions(["public_profile"]).then(
(result) => {
if (result.isCancelled) {
Alert.alert('1. cancelled!!!!!!!!!!!!!!!!!!!');
console.log("Login cancelled");
} else {
Alert.alert('222222. onFacebookClicked go');
getFacebookInfo()
}
},
function (error) {
Alert.alert('33333. Login fail with error->' + error.message);
console.log("Login fail with error: " + error);
}
);
}
);
};
test conditions
-> failed ( cacelled return )
I think when use facebook app login, safari web didn't login.. so facebook sdk return cacelled..
If loggined safari facebook web, it passed else always cacelled return.
anybody help me~
I encounter the same issue today in both the release and development environment. This is not the first time I encounter an issue like this. Here is my checklist
logInWithPermissions(['email']) to logInWithPermissions(['public_profile']) so the app could work.Check your AppDelegate.m file.
This code:
if ([[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
]) {
return YES;
}
should be above this code:
if ([RCTLinkingManager application:application openURL:url options:options]) {
return YES;
}
Otherwise, RCTLinkingManager will process the link instead of FBSDK
Check your AppDelegate.m file.
This code:
if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey] ]) { return YES; }should be above this code:
if ([RCTLinkingManager application:application openURL:url options:options]) { return YES; }Otherwise, RCTLinkingManager will process the link instead of FBSDK
Thanks a lot, this helped us, we have had similar issue:
Everything works fine unless you have installed Facebook app on your phone (which I guess most of the people do), _FB Login Flow_ is broken, meaning
And that basically it, like infinite loop which I can only "exit" by exiting whole "flow", thus not being able to _Login with FB_
I think the underlying issue for us was that we are using WIX RNN and it doesn't play well with this SDK (or maybe this SDK doesn't play well with RNN, anyhow), simply adding these lines solved issue:
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([[FBSDKApplicationDelegate sharedInstance] application:app openURL:url options:options]) {
return YES;
}
return NO;
}
(even though we are not using RCTLinkingManager)
Check your AppDelegate.m file.
This code:
if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey] ]) { return YES; }should be above this code:
if ([RCTLinkingManager application:application openURL:url options:options]) { return YES; }Otherwise, RCTLinkingManager will process the link instead of FBSDK
I have used your code and it is now navigation back to the App but with error "Login Failed".
LoginManager.logInWithPermissions is failing. Any comments over here?
Most helpful comment
test conditions
-> failed ( cacelled return )
I think when use facebook app login, safari web didn't login.. so facebook sdk return cacelled..
If loggined safari facebook web, it passed else always cacelled return.
anybody help me~