简体   繁体   中英

How do I retrieve all my application requests?

I want to get all the application request in facebook. I have the following code ...It seems it returns me an empty array. Why is that ..Is there an alternative way using javascript to retrieve all my application requests?

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


           }    

This "Unknown path components: /access_token=myaccesstoken" error message means, you try to access to something what is not exist. Check the documentation which paths are exist.

If youtry to get information about the user, replace this

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

In this case you access to /me information with the access_token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM