Closed CharlyJazz closed 4 years ago
Having the same issue -
<LoginButton
permissions={["email"]}
onLoginFinished={() => Alert.alert("User logged in")}
onLogoutFinished={() => Alert.alert("User logged out")} />
"react-native-fbsdk": "^1.1.1" react: 16.8.6 => 16.8.6 react-native: 0.60.5 => 0.60.5
onLogoutFinished is called, but not onLoginFinished
Though the button's text does change to "Log out"
Using the LoginManager (as shown here) does invoke the correct callback
Hi, I found a strange behavior. The onLoginFinished is issued in release mode(react-native run-android --variant=release), but NOT in debug mode.
I was not able to repro this on Android or iOS with the following versions. Facebook app wasn't installed.
{
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-fbsdk": "^1.1.2"
}
This reproduce on android exactly with
{
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-fbsdk": "^1.1.2"
}
To reproduce this, you must reload once the application. If i delete all the data saved by the application, onLoginFinished is called. If i shake the device, and chose reload, when i try to login onLoginFinished is not called anymore. The login is done with success. Button changes from "Continue with facebok" into "Disconnect". If i reload again the app, because i check in constructor if i'm logged in, i will be logged in. Problem is that at login, only the button is changed, not the rest of the screen, because my state doesn't change anymore via onLoginFinished. I tried to find if another event is fired, but without success.
I also have this issue, seems like it's something to do with reloading/debugging the app.
Same issue here in debugging mode. It was called the first time so I assume its because of the data stored in app. It's going to be painful to re build react native everytime I want to debug this. Any other suggestions?
As a work around, I don't use reload function of the client. If I want a refresh, I either close the app, remove from recent opened apps, and open again the app, either use the auto refresh option by changing something in the code, and app will refresh to new code. HTH
Do you mean the live reload?
@stefandima can you please elaborate, because closing app and opening again doesn't work for me.
Solution is to rebuild now the application. Install again on the device, and after that never use the reload option directly from application. If you will need a reload after that, either close the app, remove from memory, and start again (sometime is needed because is loosing connection with the Metro Server), either relay on live reload. Never:
I have done that remove app from device and build again .Issue persist OnLoginFinished never firing.
Gradlew clean and run react native run Android again
On Sat, 2 May, 2020, 3:01 pm Jaffarraza12, notifications@github.com wrote:
I have done that remove app from device and build again .Issue persist OnLoginFinished never firing.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native-fbsdk/issues/687#issuecomment-622925850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMJ3FQHXCOOLONQKXALX5F3RPPR5ZANCNFSM4KAE46XQ .
I found my problem after going through this.https://github.com/facebook/react-native-fbsdk In my MainActivity class I was using CallbackManager instance locally initiated. After referring to CallbackManager instance of MainApplication class, onLoginFinished functioned triggered!! :)
please refer : https://reactnativecode.com/facebook-login-integration/
the problem is that it fires once and then creates some cache somewhere and it ignores onLoginFinish, but I need to retest the server's responses. The callback works, but some problem in the memory
I found my problem after going through this.https://github.com/facebook/react-native-fbsdk In my MainActivity class I was using CallbackManager instance locally initiated. After referring to CallbackManager instance of MainApplication class, onLoginFinished functioned triggered!! :)
please refer : https://reactnativecode.com/facebook-login-integration/
Tried this, did not work for me :-(
I have the issue with :
@CharlyJazz Can you tell us why you closed the issue ? I still have the problem. Did you fix it ?
Personnally, I went around it in a dirty way : On the screen with the LoginButton, I asked every 0.1s fbsdk's AccessToken.getCurrentAccessToken -> if it returns something, I can log my user (because he is logged in).
But I'd rather have an event fired on onLoginFinished ...
I was facing the same problem, the problem was that I didn't enter my hash key while enabling Facebook login also I didn't tell my Package Name and Default Activity Class Name.
Just make sure you follow all the steps in Quick Start after enabling the Facebook login, you might missing something or doing something wrong while following Quick Start.
Like I am still doing now and getting Error The key hash does not match any stored key hashes
.
To resolve this error I am going through #424 I am sure I will find a solution :)
This code was copypasted from the README. And not work. BUT onLogoutFinished its called perfectly.
Env