如何检索所有应用程序请求

How do I retrieve all my application requests?

本文关键字:应用程序 请求 检索 何检索      更新时间:2023-09-26

我想在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.
              }
             });

           }    

此"Unknown path components:/access_token=myaccesstoken"错误消息意味着,您试图访问不存在的东西。检查文档中存在哪些路径。

如果你想获取用户的信息,替换这个

'/me/apprequests/access_token=' to '/me?access_token = '

在本例中,您使用access_token访问/me信息