facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 906 forks source link

Not able to login with facebook app only in iOS #829

Closed saurabh874 closed 3 years ago

saurabh874 commented 3 years ago

Social: Authentication- Unable to authenticate connection to Facebook through Facebook app, whereas able to authenticate connection when Facebook app not installed on iOS Device.

anybody have any idea how to resolve it?

yash-sage commented 3 years ago

@saurabh874 before triggering LoginManager.logInWithPermissions, set the login behaviour to web_only LoginManager.setLoginBehavior('web_only'); It worked in my case

aguscha333 commented 3 years ago

@saurabh874 this answer in this other issue helped me solve this very same issue in my app https://github.com/facebook/react-native-fbsdk/issues/785#issuecomment-731925742

For more context on how to reproduce it, you need to be logged out of Facebook in safari and have the Facebook app downloaded and be logged in. If you are logged in in safari then it doesn't get to the Facebook app because you already have the account setup on the web view.

saurabh874 commented 3 years ago

@aguscha333 thanks. you saved my lot of time.