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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With