Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game Center: addRecipientsWithPlayerIDs... How does it make sense?

You use addRecipientsWithPlayerIDs as part of configuring a GKFriendRequestComposeViewController, as in this example from Apple:

- (void) inviteFriends: (NSArray*) identifiers
{
    GKFriendRequestComposeViewController *friendRequestViewController = [[GKFriendRequestComposeViewController alloc] init];
friendRequestViewController.composeViewDelegate = self;
if (identifiers)
{
    [friendRequestViewController addRecipientsWithPlayerIDs: identifiers];
}
[self presentModalViewController: friendRequestViewController animated: YES];
[friendRequestViewController release];
}

I am confused by this entire proposition. Supposedly, you invite friends by passing some PlayerIDs to the request. But you can only get playerIDs from players who are already friends. Thus, you cannot invite people to be friends who are not already friends and you can only invite people to be friends who are already friends. What is the point of this method; how does it work?

I know there is an equivalent for email addresses or just leaving it blank, but I am trying to understand what the purpose is of this method. It seems useless, which means I am missing some very key fact about how the friend request works. Thanks to anyone who has built this and can shed some light.

like image 753
SG1 Avatar asked Mar 14 '12 17:03

SG1


1 Answers

There are scenarios where you get player IDs of players who are not in your friends list. For example, GKMatchmakerViewController may call your matchmakerDelegate with playerIDs of players who are not in your friends list.

like image 91
Tammo Freese Avatar answered Sep 25 '22 07:09

Tammo Freese