auth.statusChange doesn't fire during FB.init if the user isn't logged in to facebook

后端 未结 3 710
天命终不由人
天命终不由人 2021-02-05 11:14

I wondered if anyone has found a workaround to the behaviour that I\'m experiencing.

Take the example of the below code:



        
3条回答
  •  情书的邮戳
    2021-02-05 11:26

    My best solution for this was to set status to 'false' in the fb.init options, then to explicitly call getloginstatus separately.

    IF get loginstatus came back as unknown (i.e. logged out), I subscribed to the status change event, as well as doing the usual of displaying the login button. Then when the user logs in, status change fires as expected.

提交回复
热议问题