1

i am using following code to get all my friends ,but it gives only 5 friends in data and next pagination link,i have 22 friends but when i click on next pagination gives empty array data

    FB.api('/me/friends/?access_token=CAACEdEose0cBAIgrQyQs6DaApZAwDCpSub2WHKXaU3inS1QPvcep24avZCoVpyYcHoWgZBltVdFKbKy8UokU6x2JXGEgeDcRu3C3sM2dEZCuzQIsbZALFGPcamyRqR5ZA4VE8c0U2KNcKNar5qVzo9ToAr6BQatoJKd4dIiXg3dqoS4RLlszQjfm3Yf66XxtKxPyIHEDhudQCLgBZCcINLlucERa4ZBf9a8ZD',function(response) {
                                console.log(response);
                                if (response && !response.error) {
                                    var nextPage = response.paging.next; 
                                    FB.api('v2.1/248176728710033/friends?limit=10&access_token=CAACEdEose0cBAIgrQyQs6DaApZAwDCpSub2WHKXaU3inS1QPvcep24avZCoVpyYcHoWgZBltVdFKbKy8UokU6x2JXGEgeDcRu3C3sM2dEZCuzQIsbZALFGPcamyRqR5ZA4VE8c0U2KNcKNar5qVzo9ToAr6BQatoJKd4dIiXg3dqoS4RLlszQjfm3Yf66XxtKxPyIHEDhudQCLgBZCcINLlucERa4ZBf9a8ZD&offset=10&__after_id=enc_AeysBhpBnD6OYeeb4OHHT4qPay7GeUF8OUqNU7PcF3HilkONx4E5EXzymARn2J3u7msA2J4PqjbJyyCE51vHJCOX',function(resp){
                                        console.log(resp);
                                    });

                                }
                                //                                   

                            });
Rakesh jha
  • 83
  • 1
  • 12

1 Answers1

0

It is not possible to get ALL friends anymore, see my answer in this thread: how to get a list of all user friends (not only who use the app)?

If you still get friends who aren´t using your App, it could be because your App was created before end of April 2014. In that case, it´s a v1.0 App. Your are using /me/friends without a version tag in the first call, but with a version tag in the second call. Also, use /me instead of that id (248176728710033).

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • I am already getting two user who is not using my App. After that to see next i am getting paging link,but it gives an empty set of data – Rakesh jha Oct 04 '14 at 09:55
  • that can only be a bug, or they ARE using your app. – andyrandy Oct 04 '14 at 09:57
  • btw, you really don´t need to use the access token on your own. that´s one reason to use one of the SDKs: you don´t need to worry about the access token in most cases. – andyrandy Oct 04 '14 at 09:57
  • i´ve added some more information for your specific case – andyrandy Oct 04 '14 at 09:59
  • Hey lunschn ,thank you for replying me. Please check this one. https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me%2Ffriends&version=v2.1 In GET pass me/friends and it will give all the friends with pagination ,but pagination is not working for me I am getting here,you can also try. No they are not using my App – Rakesh jha Oct 04 '14 at 10:06
  • that´s with the "graph api explorer" app selected. lots of people are using that one, of course you get more users with that app but you still don´t get ALL friends. – andyrandy Oct 04 '14 at 10:27
  • Yeah but even there the next pagination link is giving an empty set of data – Rakesh jha Oct 04 '14 at 10:29
  • exactly, because there are not more friends using the app. take a look at the additional text in my answer. – andyrandy Oct 04 '14 at 10:29
  • Ok, luschn , Can you please guide me to get the user who is not using my and send them a request ,please ? I am using javaScript SDK – Rakesh jha Oct 04 '14 at 10:31
  • http://screencast.com/t/adLidH9Kjgms Please check this one , screenshot of my console response, and no one is using my App from these list – Rakesh jha Oct 04 '14 at 10:43
  • check out my answer in that other thread, it´s all in there. see "invitable_friends". – andyrandy Oct 04 '14 at 11:04