在Facebook应用中要求特定用户的权限。

问题描述 投票:0回答:1

我的Facebook应用程序出现了问题。该应用程序是活的时刻,我收到了一封电子邮件从Facebook。

我们发现您的应用程序违反了以下政策 您需要在2012年4月17日星期二下午5点前解决这个问题 否则您的应用程序可能会被强制执行。

我们的政策要求您的应用程序有一个隐私政策,告诉用户您将使用哪些用户数据,以及您将如何使用、显示、共享或传输这些数据,并且您将在开发者应用程序中包含您的隐私政策 URL(请参阅平台政策 II.3, http:/developers.facebook.compolicy).

我们注意到,您的应用程序在权限对话中缺少隐私政策。请更新开发者应用程序中的隐私政策URL字段,网址为developer.facebook.comapps[YOUR_APP_ID]auth。此外,请检查您的应用程序,以确保您也在您的网站或应用程序中显示您的隐私政策。

我的应用程序只使用基本用户信息。

我正在使用Javascript SDK进行基本用户认证,但我不知道如何要求用户获得正确的权限。

<div id="fb-root"></div>
 <script>
 window.fbAsyncInit = function() {
FB.init({
  appId      : '[APPID]', // App ID
  channelUrl : '[URL]', // Channel File
  status     : true, // check login status
  cookie     : true, // enable cookies to allow the server to access the session
  xfbml      : true  // parse XFBML
});  
var login = false;
 FB.getLoginStatus(function(response) {
          if (response.status === 'connected') {
              console.log('connected');
              login=true;
                // the user is logged in and connected to your
                // app, and response.authResponse supplies
                // the user's ID, a valid access token, a signed
                // request, and the time the access token 
                // and signed request each expire
                var uid = response.authResponse.userID;
                var accessToken = response.authResponse.accessToken;
          }
          else{
              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 + '.');
                   if(login===false)
                   {
                       window.open("http://www.facebook.com/EnergyZuerich/app_332399760133904", "_top");
                   }
                   //window.location.href=window.location.href;
                   //FB.logout(function(response) {
                     //console.log('Logged out.');
                   //});
                 });
               } else {
                 console.log('User cancelled login or did not fully authorize.');
               }    
             }, {scope: 'email'});
          }});

// Additional initialization code here
 };
  (function() {
     var e = document.createElement('script');
      e.async = true;
     e.src = document.location.protocol +
     '//connect.facebook.net/en_US/all.js';
     document.getElementById('fb-root').appendChild(e);  
   }());
 // Load the SDK Asynchronously
(function(d){
    var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
 }(document));

</script>

有人能帮忙吗?

javascript facebook authentication facebook-javascript-sdk dom-events
1个回答
1
投票

他们的电子邮件清楚地告诉你该怎么做,即为你的隐私政策创建一个可公开访问的URL,并为你的应用程序更新URL字段。您可以在管理您的应用程序的Facebook上进行此操作。

© www.soinside.com 2019 - 2024. All rights reserved.