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 910 forks source link

Double click on Login button makes application hang excessively #708

Open Rogerio-Bertoldo opened 4 years ago

Rogerio-Bertoldo commented 4 years ago

🐛 Bug Report

After inserting the necessary credentials for logging in (email and password), I've experienced the following behaviors: 1) (Expected behavior) Clicking on the login button once executes de login successfully after a while. 2) (Non-expected behavior) If the user clicks on the login button twice, the modal changes to "Loading" and login doesn't get finished. One might wonder why the user would click the button twice. The problem is (probably) because slow internet connection, since after the first time clicked, the sign in button looks disabled. And after a few seconds, it changes back to enabled, giving the idea that the login wasn't successful. Then if you click it again, the behavior explained before happens (modal changes to "Loading"...). When this happens, the console on Android Studio (debug mode) shows the message: "request cursor anchor info on inactive input connection"

Does any one know if there's a way to get information about the login button being clicked? Because then I could set a timeout to finish the attempt to login after a while.

To Reproduce

1) Click on Login with Facebook 2)Insert your credentials (email and password) 3)Click on Login button (it'll look disabled and enabled again). Click on it again

Step 3 might not happen always, because the successful behavior is to redirect the user to the modal "Continue with Facebook". The problem is that not only have I experienced it sometimes, but also my team was sent a message from Facebook, saying that the integration with their API was affecting user experience.

Expected Behavior

Code Example

... const result = await LoginManager.logInWithPermissions(['public_profile', 'email']); //The problem //happens here if(result.insCancelled) console.log("Cancelled") else cosole.log("Logged in successfully") ...

Environment

react-native version: 0.59 react-native-fbsdk: 0.10.3