React-native-fbsdk: On Login Finished getting called multiple times

Created on 23 Apr 2016  路  11Comments  路  Source: facebook/react-native-fbsdk

Hey guys!

Just started using FBSdk for react native. I am currently trying to implement FB Login and everything is working fine, except for one little detail.

<LoginButton
          readPermissions={["public_profile, email"]}
          onLoginFinished={
            (error, result) => {
              console.log("Logged in!");
              AccessToken.getCurrentAccessToken()
              .then((token) => {
                this._serverLogin(token);
              }, (error) => {
                console.log(error);
              });
            }
          }
          onLogoutFinished={() => alert("logout.")}/>

captura de tela 2016-04-22 as 23 21 00

onLoginFinished is being called exactly 9 times, every time I login via facebook. I followed the instructions, but don't know why is this happening.
Is this happening with someone else? Could this be a bug on the rnfbsdk or I'm doing something wrong?

Thanks in advance ;)

fixing-in-next-release

Most helpful comment

@gannetson I used 0.2.1. This bug fixed it.

All 11 comments

I can confirm that mine is also being called 9 times.

Any fix for this?

the same to me. Hope to fix it soon.

cc @dzhuowen

I get this, 9 times, at my end too!

Sorry for the error, I'll fix this issue in the next release

Closing b/c this bug is fixed in 0.2.0.

I still have this in 0.2.0. What is the commit that fixes it?

@gannetson I used 0.2.1. This bug fixed it.

Yeah, building the sdk again instead of just reloading JS did the trick. Sorry for the noob-ishness :-P

I'm seeing a similar situation to this still. onLoginFinished does not trigger at all after a JS reload.

Is there any chance this will be fixed? While this doesn't affect production, it definitely set me and my team back a few hours on a wild bug chase and I'm sure it has for many others who have encountered the issue, as well.

Was this page helpful?
0 / 5 - 0 ratings