开发者

iOS Development: Adding an "Add Friend" button inside my app

开发者 https://www.devze.com 2023-02-04 15:39 出处:网络
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 c

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消