I'm working on a game that has a "play with your Facebook friends" feature (it does not use Facebook Canvas). The setup is pretty standard. I want to display a list of all of the user's Facebook friends and if they are also users of my app, a "Play" button will show up, if not, an "Invite" button will show up.
To get the list of my Facebook friends which use the app, I make a call to
Request.newMyFriendsRequest
and then to get a list of all of my friends, I make another call to /me/taggable_friends
.
With this info, I'm able to create such a list. The issue is that if I want to send an App Request to a user, I need their user id, but the id which is returned by the /me/taggable_friends
is not the actual Facebook id of that user, but a unique id associated with my app (as explained in the documentation), so it doesn't work if I want to send an App Request using it.
To invite a friend, I'm using the following code:
Bundle params = new Bundle();
params.putString("title", "Invite Friend");
params.putString("message", "has invite has you to try out the game");
params.putString("to", id); // how do I get this id?
WebDialog requestsDialog = ( new WebDialog.RequestsDialogBuilder(this,
Session.getActiveSession(), params)).setOnCompleteListener(new WebDialog.OnCompleteListener()
{
@Override
public void onComplete(Bundle values, FacebookException error) {
}
}).build();
requestsDialog.show();
This seems to be a pretty standard setup that I've seen in many games so I know it's possible. Any ideas what I'm doing wrong? Thanks!