game-center

Game Center Friend List

别等时光非礼了梦想. 提交于 2019-12-02 01:35:33
All I made a game for the Apple iOS. Now I would like to show my friend list in Apple's Game Center. How can I show the Game Center friend list of a logged in player on an iPhone, possibly using the UIViewController (which manages the ViewControllers)? Any help would be appreciated.. Thanks... To show your Game center friends in your app you can use the below code given. -(void) retrieveFriends { GKLocalPlayer *lp = [GKLocalPlayer localPlayer]; if (lp.authenticated) { [lp loadFriendsWithCompletionHandler:^(NSArray *friends, NSError *error) { if (friends != nil) { [self loadPlayerData: friends]

What is the proper way to do GameCenter authentication?

与世无争的帅哥 提交于 2019-12-02 01:18:25
I have seen in posts around stack overflow that shows snippets of handling GameCenter authentication. However, none of these solutions address any of the problems that real world use cases cover. Namely, the [GKLocalPlayer localPlayer].authenticateHandler is just a call back of the status, and not much else. It provides a view controller, but there are massive inconsistencies in .authenticated, and error states. There are a few things I am trying to do: 1. Not pop up the game center login until a feature uses it 2. Try to authenticate silently on app launch 3. Provide some info to the user why

Game Center invite fails immediately

萝らか妹 提交于 2019-12-01 18:17:06
We're having a problem with sending invites with GKGameCenterViewController . The view controller opens up just fine, but when we try to send an invite to somebody, it immediately fails. Both accounts have game center invites enabled and finding other players through the GKGameViewController works fine. Here's the code we're using to manage the invites: This method is called as soon as the GKLocalPlayer is authenticated (authentication is called from GameViewController , this code is in a separate Game Center managing class): internal func authenticationChanged() { if GKLocalPlayer.localPlayer

Getting GameCenter invite friend to work (iOS9?)

拈花ヽ惹草 提交于 2019-12-01 18:11:06
I cannot get GameCenter invite friend to work. The match maker view controller shortly shows the invited player and a little text "Failed" under it. Maybe I picked the wrong time to learn GameCenter, as quite a few people report difficulties with iOS9. But maybe there is a solution somewhere. Basics: iTunesConnect App record exists, app is not public, GameCenter is enabled, one leaderboard has been created, two sandbox users have been created (different from my main apple id) The app has one view controller, which for now shall handle all GameCenter things In viewDidLoad the player

Game Center invite fails immediately

≡放荡痞女 提交于 2019-12-01 18:02:13
问题 We're having a problem with sending invites with GKGameCenterViewController . The view controller opens up just fine, but when we try to send an invite to somebody, it immediately fails. Both accounts have game center invites enabled and finding other players through the GKGameViewController works fine. Here's the code we're using to manage the invites: This method is called as soon as the GKLocalPlayer is authenticated (authentication is called from GameViewController , this code is in a

Game Center InviteFailed

走远了吗. 提交于 2019-12-01 17:53:42
I'm am attempting to send a Game Center invitation. Sending from the simulator to a device or from a device to the simulator results in an InviteFailed error. What might be the problem? Incorrect implementation? Low Internet speed? Or is it not possible to test Game Center invites with the simulator? Thanks As far as I am aware you cannot test multiplayer in the simulator. You will need two devices. Even though the invite functionality doesn't work in the simulator, you can still test multiplayer in the simulator using findMatchForRequest (kind of like an auto-match function): [[GKMatchmaker

Getting GameCenter invite friend to work (iOS9?)

混江龙づ霸主 提交于 2019-12-01 17:27:15
问题 I cannot get GameCenter invite friend to work. The match maker view controller shortly shows the invited player and a little text "Failed" under it. Maybe I picked the wrong time to learn GameCenter, as quite a few people report difficulties with iOS9. But maybe there is a solution somewhere. Basics: iTunesConnect App record exists, app is not public, GameCenter is enabled, one leaderboard has been created, two sandbox users have been created (different from my main apple id) The app has one

How do I reply to a GKTurnBasedExchange? GKLocalPlayerListener delegate receivedExchangeReplies is called intermittently

时光怂恿深爱的人放手 提交于 2019-12-01 12:12:32
There are a handful of posts discussing how Game Center's push notifications were fairly unreliable in the sandbox. However, the sandbox is obfuscated with iOS 9 so, I'm not sure why my Game Center push notifications are so unreliable. When I reply to the active exchange, the sender is rarely notified. [exchange replyWithLocalizableMessageKey:@"EXCHANGE_REPLY" arguments:@[] data:data completionHandler:^(NSError *error) { if (error) { NSLog(@""); } }]; On the senders device, if I refresh the match data, I'll see a pending reply. If I process the reply, everything works. The same goes for this

Good practices for Game Center matchData

*爱你&永不变心* 提交于 2019-12-01 10:36:02
I am new to GKTurnBasedMatch and i'm trying to figure out what are good practices for the "matchData" sent between players during turns. All the tutorials i've found mainly cover sending a string of text and I would like to send a lot more than that. It would be great if someone could pint me to a more advanced tutorial. An example of what I would like to do is a battle. The two players have their avatars and they have different details (health, attack, defence, etc), how should I send this data? The only way I see possible is to codify all the match details (a lot of them) into an

Is there a way to update matchData in a GKTurnBasedMatch without sending out “Your Turn” push notifications?

给你一囗甜甜゛ 提交于 2019-12-01 10:29:25
If my understanding is correct, the only way to update the matchData property of a GKTurnBasedMatch mid-turn is [_currentMatch endTurnWithNextParticipant:_currentParticipant matchData:matchData completionHandler:nil]. This works well if the Game Center player only has the game installed on one device because the notification is delivered to the device as a message to the app. Thus, the notification can be hidden while the user is currently playing his turn. However, if the user has the game installed on multiple devices, the other devices will get a "Your Turn" push notification. This is