game-center

Is Game Center Multiplayer Friends broken in IOS 9?

半腔热情 提交于 2020-01-03 13:10:10
问题 I created a game that uses real-time multiplayer programmatically. It was originally targeted to towards IOS 8 devices. Recently after migration to IOS 9, Game Center has caused a lot of problems. The main issue I cannot resolve is Inviting a friend in multiplayer (for testing). From IOS 8 to IOS 8. Auto match works and Friend invitations work But from IOS 9 to IOS 9. Auto match works and Friend invitations do not work anymore. If any of you have managed to make Game Center invitations work

GameKit Turn-based listener is not reliably called when matchData changes

吃可爱长大的小学妹 提交于 2020-01-03 02:41:10
问题 I am using Game Center turn-based matches for my card game. It feels like a good fit because people want to check their email or write a text sometimes between turns. Some users have said that they do really want to be able to have a very asynchronous playing experience. For the people that are keeping the game open between their turns, I want to update the screen to reflect things that the other players are doing on their turns. I have set up a listener on GKLocalPlayer that responds to

fatal error: can't unsafeBitCast between types of different sizes (using gamekit)

▼魔方 西西 提交于 2020-01-02 19:31:07
问题 Using GameKit Multiplayer feature (EasyGameCenter) found here: https://github.com/DaRkD0G/Easy-Game-Center-Swift Upon two players connecting I get a crash on this line let playerIDs = match.players.map { $0 .playerID } as! [String] With this in console fatal error: can't unsafeBitCast between types of different sizes Any ideas? Here is full function for easy reference: @available(iOS 8.0, *) private func lookupPlayers() { guard let match = EGC.sharedInstance.match else { EGC.printLogEGC("No

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

Game Center authentication error

China☆狼群 提交于 2019-12-30 07:03:13
问题 I'm trying to call the authentication method of game center, however no authentication screen comes up and the callback return with an error : "the requested operation has been canceled". The code : [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { NSDictionary *userInfo = nil; if (error == nil) { NSLog(@"Game Center successfully authenticated"); } else { userInfo = [NSDictionary dictionaryWithObject:error forKey:@"NSError"]; } [[NSNotificationCenter

How to accept an invitation in Game Center

筅森魡賤 提交于 2019-12-30 04:49:24
问题 I'm trying to implement invitations with Game Center and there's one thing that i don't understand. Ok, i've sent an invitation from one device to another. Then i have an UIAlertView on receiver which asks me i would like to accept or decline the invitation. when i accept it it is handled like this: [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) { // Insert application-specific code here to clean up any games in progress. if

How to put GameCenter on application with swift?

孤街醉人 提交于 2019-12-25 04:28:07
问题 I made a game using SpriteKit and Xcode 7 beta. I tried to add GameCenter and Leaderboard but the problem is that the score in the leaderboard won't change (HighScore doesn't upload to GameCenter), It stay 0 all the time and I don't know how to fix it. I'm using 2 different files: GameViewController.swift, and PointsLabel.swift GameViewController.swift: import GameKit class GameViewController: UIViewController,UIGestureRecognizerDelegate, GKGameCenterControllerDelegate { var score:

How to put GameCenter on application with swift?

。_饼干妹妹 提交于 2019-12-25 04:28:01
问题 I made a game using SpriteKit and Xcode 7 beta. I tried to add GameCenter and Leaderboard but the problem is that the score in the leaderboard won't change (HighScore doesn't upload to GameCenter), It stay 0 all the time and I don't know how to fix it. I'm using 2 different files: GameViewController.swift, and PointsLabel.swift GameViewController.swift: import GameKit class GameViewController: UIViewController,UIGestureRecognizerDelegate, GKGameCenterControllerDelegate { var score:

Game Center Leader Board Error

谁说我不能喝 提交于 2019-12-25 03:56:27
问题 I created this code for game center Leaderboards, and I always get Thread 1 signal Sigabrt . The NSLOG always says this : 2014-04-15 15:27:28.441 GameCenter[38225:60b] -[GKGameCenterViewController setLeaderboardDelegate:]: unrecognized selector sent to instance 0xb48dd90 2014-04-15 15:27:28.442 GameCenter[38225:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GKGameCenterViewController setLeaderboardDelegate:]: unrecognized selector sent to instance