脸书图FB.登录连接对话框,取消事件

Facebook graph FB.login connect dialog, cancel event

本文关键字:对话框 取消 事件 连接 登录 FB      更新时间:2023-09-26

当用户未连接并且一切似乎都很好时,我正在使用FB.login,尽管当用户在fb connect对话框中单击取消时,它会关闭,我必须在我的页面上引发一个事件此取消事件(或至少在用户点击取消时重定向到某个地方)。

搜索了又搜索,但找不到如何引发此类事件(我尝试订阅"auth.cancel",但它不起作用)。

有什么想法吗?

当用户取消登录时,他将被重定向到具有以下GET参数的页面:

  1. error_reason=user_denied
  2. 错误=access_denied
  3. error_description=The+user+denied+your+request。

编辑:

在 JS SDK 中,如下所述:

 FB.login(function(response) {
     if (response.authResponse) {
         console.log('Welcome!  Fetching your information.... ');
         FB.api('/me', function(response) {
            console.log('Good to see you, ' + response.name + '.');
         });
     } else {
         console.log('User cancelled login or did not fully authorize.');
     }
 });