iOS Development: Adding an "Add Friend" button inside my app
I'm building an iPhone game that uses Game Center to auto-connect random players looking for a game. When the match is finished, I wanted to give the players the option to add the opponent as a game center friend so they can play them again in the future.
If I have the opponents GKPlayer data, including their playerID and alias, how can I allow the player to add the opponent as a friend in Game Center via my app? Or is this only possible 开发者_Go百科through the Game Center app itself?
Thanks so much for your help!
Looks like GKFriendRequestComposeViewController
is what you are after? It allows you to send out a friend request (and even has a premade modal view controller)
精彩评论