14

I am aware that invitable friends (https://developers.facebook.com/docs/games/invitable-friends/v2.0) requires canvas and category game. And I have also requested for user_friends permission on initial approval of the user. I have done all that and when I use /me/invitablefriends in graph api it returns the desired results. But when I try to do the same with facebook plugin in phonegap I get the following error. "The operation couldn't be completed. (com.facebook.sdk error 5.)

$("#invitefriends").click(function() {
    facebookConnectPlugin.api("me/invitable_friends", ["user_friends"], function (response) {
         alert(JSON.stringify(response));
    }, function (error) {
         alert("error "+error);
    });
});
Saad Bashir
  • 4,341
  • 8
  • 30
  • 60
  • My guess would be that it should look something like: `facebookConnectPlugin.api("me/invitable_friends", function (` – WizKid Jun 03 '14 at 05:09
  • well i had my doubts too. So i tried that too since I am new to this but nope didn't work. It doesn't give any error though. It just doesn't return anything – Saad Bashir Jun 03 '14 at 05:14
  • You need to remove the `, ["user_friends"]` part – Tobi Jun 05 '14 at 07:33
  • I have already tried that like I said in my above comment. It doesn't return any error or anything else if I do that – Saad Bashir Jun 05 '14 at 08:00

1 Answers1

0

I had used the below code to get the user's invitable friends.See if this helps : facebookConnectPlugin.api('/me/friends?fields=id,name,picture',["public_profile","user_friends"],