FB.getLoginStatus never fires the callback function in Facebook's JavaScript SDK

后端 未结 6 855
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 19:04

The simple thing of calling FB.init (right before ) and then FB.getLoginStatus(callback) doesn\'t fire the callback funct

6条回答
  •  忘掉有多难
    2021-01-04 19:43

    I understand that this question is a little old now, but I ran across it searching for solutions.

    Double-check what you have set in your Facebook app configuration under the section "Website with Facebook Login". The Site URL domain must match the domain your page with the FB.getLoginStatus (and other related auth Javascript) is served from.

    After hours of struggling, I realized that I could not reuse an existing app configuration I had on a new server and had to create a new app to handle the website login for this new server.

    The other answers are probably equally valid in your specific case, but since there may be others like me who have struggled for a while on this, hopefully this gives you one other place to check. Making a new app with the correct Site URL was the answer in my particular case.

提交回复
热议问题