在Facebook上用Javascript请求扩展权限的正确方法是什么?

What is the proper way to ask for Extended Permissions on Facebook with Javascript?

本文关键字:方法 是什么 权限 上用 Facebook Javascript 请求 扩展      更新时间:2023-09-26

我还应该使用权限吗?是请求还是有新的方法?我看到了相互矛盾的信息。谢谢!

您可以使用FB.login()scope参数:

 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 + '.');
       FB.logout(function(response) {
         console.log('Logged out.');
       });
     });
   } else {
     console.log('User cancelled login or did not fully authorize.');
   }
 }, {scope: 'email'});
讽刺的是,Facebook昨天刚刚发布了一个相关的教程。我也写了一个教程,关于这段时间。