Facebook SDK: Replace “Log In” button with custom image

放肆的年华 提交于 2019-11-29 17:23:56

You can use the JS Api for this,

function fbAuth() {
    FB.login(function(response) {
      if (response.authResponse) {
        alert('User fully authorize the app.');
      } else {
        alert('User canceled login or did not fully authorize the app.');
      }
    }, { scope: 'friend_likes' });
}

then you can call it in a custom button with the onclick event:

<a href="#" onclick="return fbAuth();">Login</a>

Facebook Documentation: FB.login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!