2011-12-28 28 views
0

我想在facebook中獲得所有的應用程序請求。我有以下代碼...它似乎返回一個空數組。 這是爲什麼..是否有一種替代方式使用JavaScript來檢索我的所有應用程序請求?如何檢索我的所有應用程序請求?

function Getrequests2() 
      {  

       FB.getLoginStatus(function(response) { 
       if (response.status === 'connected') { 
       // 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 access_token = myaccesstoken; 

       FB.api('/me/apprequests/?access_token='+access_token, function(user) 
              { 

                if (user) { 
                    alert(access_token);console.log(user); 
                 } 
              } 
         ) 
       } else if (response.status === 'not_authorized') { 
       // the user is logged in to Facebook, 
       //but not connected to the app 
       } else { 
       // the user isn't even logged in to Facebook. 
       } 
      }); 


      }  

回答

0

這個「未知的路徑組件:/ =的access_token myaccesstoken」錯誤消息意味着,您嘗試訪問的東西什麼是不存在的。檢查文檔哪些路徑存在。

如果youtry獲取有關用戶的信息,替換該

'/ ME/apprequests /的access_token =' 到 '/我?的access_token ='

在這種情況下可以訪問與/我發信息access_token。

相關問題