gamekit

Inviting a Game Center friend to a match programmatically

99封情书 提交于 2020-01-01 09:13:13
问题 Does GameKit allow you to invite a specific Game Center friend to a match, programmatically, i.e. without presenting the GC ViewController? The following handleInviteFromGameCenter documentation seems to imply that you can populate GKMatchRequest.playersToInvite and use it with [GKTurnBasedMatch findMatchForRequest]: When your delegate receives this message, your application should create a new GKMatchRequest object and assign the playersToInvite parameter to the match request’s

Handling Game Center authentication

人盡茶涼 提交于 2020-01-01 00:11:19
问题 According to the Apple docs we should do something like this to handle GC authentication: - (void) authenticateLocalUser { GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; if(localPlayer.authenticated == NO) { [localPlayer setAuthenticateHandler:(^(UIViewController* viewcontroller, NSError *error) { if (!error && viewcontroller) { DLog(@"Need to log in"); AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; [appDelegate.window.rootViewController

GameKit achievement questions

蓝咒 提交于 2019-12-25 14:47:11
问题 My game center achievements are appearing in Game Center, so I know my implementation is correct in reporting. Couple of questions on that. First, in Game Center it is not showing the percentage view on the image... ie 2% complete next to the achievement, even though I have reported .02. I know the achievement is being reported because if I throw the 100 at it, it records the achievement. Second, my achievements are not appearing to the user upon reward. As I understood, this functionality

GameKit achievement questions

旧街凉风 提交于 2019-12-25 14:46:07
问题 My game center achievements are appearing in Game Center, so I know my implementation is correct in reporting. Couple of questions on that. First, in Game Center it is not showing the percentage view on the image... ie 2% complete next to the achievement, even though I have reported .02. I know the achievement is being reported because if I throw the 100 at it, it records the achievement. Second, my achievements are not appearing to the user upon reward. As I understood, this functionality

How to implement GKTurnBasedMatchOutcomeCustomRange?

夙愿已清 提交于 2019-12-25 01:41:17
问题 I've looked in the Apple GameKit Programming Guide, as well as the documentation of the GKTurnBasedParticipant to try and figure out how to implement the custom range. Apple docs say: "Optionally, it may also use an OR operation to include a custom match outcome for your specific game. Game Center does not use the custom value; it exists to allow your game to provide additional information at the end of the match. The custom value must fit in the range provided by the

My GKMatch has no players…?

大憨熊 提交于 2019-12-24 19:03:24
问题 I successfully made a matchmaking screen appear. I run my game in my iPhone and also in the simulator. In both cases I log in with a different Game Center account. I go to the matchmaking screen in both games. I press "play now". Both games begin looking for a match. Finally, both games find a match and call the function below: - (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match { self.myMatch = match; NSLog(@"%d",[[self.myMatch

Only one player displayed in Game Center leader board (Sandbox)

早过忘川 提交于 2019-12-24 15:33:24
问题 In the sandbox environment of Game Center I tested with 2 different users. Unfortunately I only see one player in the leader board. Only the player who is logged in. I thought it should update after a while but now (24 hours later) I still only see one user in the leader board. Is this correct in the sandbox environment? 回答1: Obviously it takes more than 24 hours to update the leader board. After +/- 48 hours, the other user also disappeared in the Game Center Leaderboard. 来源: https:/

Different builds of turn-based Game Center game can’t see each other’s matches

核能气质少年 提交于 2019-12-24 03:53:24
问题 Each time I deploy a new build to testers, games from an older build are no longer available. As a test, I installed build 63 (numbered by agvtool ) on one device and 64 on another. I invited from 64. 63 saw nothing (neither a Game Center invite, or when using the GKTurnBasedMatchmakerViewController ). So I installed 64, and the invite showed up. I am using a script to build (using xcodebuild to make an archive, and then ZIPping up a .ipa), though it's the same script each time. I haven’t

Authenticate GameKit local player using swift

旧街凉风 提交于 2019-12-24 02:31:44
问题 Im looking to migrate a game over to swift, the only trouble I am having is with blocks/closures. It's the syntax I just don't understand, whereas in Objective C I would use: GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){ if (viewController != nil) { [self presentViewController:viewController animated:YES completion:nil]; } } etc.etc. but I'm not sure how to go about doing the same in Swift. I

How do I get a GKPlayer's status from Game Center?

那年仲夏 提交于 2019-12-23 16:11:19
问题 When I get a GKLocalPlayer or use loadPlayersForIdentifiers:identifiers withCompletionHandler: to get a list or individual GKPlayer aliases, the GKPlayer object when logged, looks something like this: 2010-09-23 10:39:01.759 Cee-lo[76500:207] Players loaded by identity: ( "<GKPlayer 0x84125a0>(playerID: G:1234567890, alias: typeonetester1, status: Adding test friends., rid:(null))", "<GKPlayer 0x8412530>(playerID: G:1234567890, alias: typeonetester2, status: Adding Game Center to app, rid: