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

You use addRecipientsWithPlayerID as part of the GKFriendRequestComposeViewController setting, 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]; } 

All this sentence confuses me. Presumably, you invite friends by passing some player identifiers to the request. But you can only get player identifiers from players who are already friends. Thus, you cannot invite people to be friends who are not friends yet, and you can only invite people to friends who are already friends. What is the meaning of this method; how it works?

I know there is an equivalent for email addresses or just leaves it blank, but I'm trying to figure out what the purpose of this method is. This seems useless, which means I miss some very important fact about how a friend’s request works. Thanks to everyone who built this and can shed some light.

+6
source share
1 answer

There are scenarios in which you get player identifiers for players who are not on your friends list. For example, GKMatchmakerViewController might call your matchmakerDelegate playerIDs for players who are not on your friends list.

+1
source

Source: https://habr.com/ru/post/910733/


All Articles