game-center

iOS Gamecenter Programmatic Matchmaking

情到浓时终转凉″ 提交于 2020-02-05 04:24:07
问题 I'm trying to implement a real-time multiplayer game with a custom UI (no GKMatchMakerViewController ). I'm using startBrowsingForNearbyPlayersWithReachableHandler: ^(NSString *playerID, BOOL reachable) to find a local player, and then initiating a match request with the GKMatchmaker singleton (which I have already initiated). Here's where I'm having trouble. When I send a request, the completion handler fires almost immediately, without an error, and the match it returns has an expected

GKMatchmakerViewController failed

落花浮王杯 提交于 2020-01-25 12:23:06
问题 In my app, I can see data for Leaderboards and Achievements that I have created using iTunesConnect. I can use GKTurnBasedMatchmakerViewController with no problem. But if I use GKMatchmakerViewController , immediately after selected a friend to invite, the GKMatchmakerViewController comes back with a "failed" indication (see image). That was not all. If I use another bundle id (one that already on AppStore) just to test, then GKMatchmakerViewController will work on this app. I have also tried

Definitive answer to what playersToInvite is for

梦想的初衷 提交于 2020-01-16 04:53:28
问题 The Game Center documentation indicates that the playersToInvite parameter is non-nil when your application is launched directly from the Game Center application to host a match. A few people have asked how this works exactly, i.e. there doesn't appear to be a way to select a friend from the Game Center application and invite them to play from Game Center; it only works when you invite in-game. Is this documentation dated or is there a secret way to start a game-specific match from Game

GKLeaderboardViewController initial leaderboard

浪子不回头ぞ 提交于 2020-01-15 04:57:39
问题 When GKLeaderboardViewController is presented, it shows first leaderboard on the list, even if the GKLeaderboardViewController 's leaderboard category is not set. Only way to see the list of all leaderboards is clicking Leaderboards button at the top. Is there any way to display list of all leaderboards when GKLeaderboardViewController is presented? 回答1: You can set category to nil. GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if

Game Center groups

瘦欲@ 提交于 2020-01-13 11:36:27
问题 I have an iOS game with one Game Center leaderboard. I published the game a few months ago and now I'm working on the OSX version. I want to use the same leaderboard for both versions of the game, which means that I need to create a Game Center group. The problem is that Apple forces you to modify your leaderboard ID's when you move them into a group: Group ids must begin with grp. Now, if I do that, I will need to update the iOS version of the game so that my users can keep posting their

iOS Game Center - authentication error on one device

我怕爱的太早我们不能终老 提交于 2020-01-12 01:42:27
问题 On one of my devices (an iPad mini running iOS7), when I attempt to authenticate in Game Center I get the dreaded error: Authentication Error: Error Domain=GKErrorDomain Code=2 "The requested operation has been cancelled or disabled by the user." UserInfo=0x15ef0f00 {NSLocalizedDescription=The requested operation has been cancelled or disabled by the user.} I am clearly logged into Game Center. I have completely wiped the app from the device and even a fresh run from Xcode after deleting the

iOS Game Center - authentication error on one device

断了今生、忘了曾经 提交于 2020-01-12 01:42:26
问题 On one of my devices (an iPad mini running iOS7), when I attempt to authenticate in Game Center I get the dreaded error: Authentication Error: Error Domain=GKErrorDomain Code=2 "The requested operation has been cancelled or disabled by the user." UserInfo=0x15ef0f00 {NSLocalizedDescription=The requested operation has been cancelled or disabled by the user.} I am clearly logged into Game Center. I have completely wiped the app from the device and even a fresh run from Xcode after deleting the

iOS: Best Way to do This w/o Calling Method 32 Times?

主宰稳场 提交于 2020-01-11 14:07:59
问题 I'm currently retrieving the Top 100 Scores for one of my leaderboards the following way: - (void) retrieveTop100Scores { __block int totalScore = 0; GKLeaderboard *myLB = [[GKLeaderboard alloc] init]; myLB.identifier = [Team currentTeam]; myLB.timeScope = GKLeaderboardTimeScopeAllTime; myLB.playerScope = GKLeaderboardPlayerScopeGlobal; myLB.range = NSMakeRange(1, 100); [myLB loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { if (error != nil) { NSLog(@"%@", [error

GKMatchmaker findMatchForRequest invite never received

喜你入骨 提交于 2020-01-11 08:51:17
问题 I'm trying to invite nearby players to a match, but the invite is either never sent or never received. GKMatchMaker startBrowsingForNearbyPlayersWithHandler works and returns nearby players that are on same wifi, but then I use findMatchForRequest and it returns a match without any players, and the players I try to invite never receive an invite notification. Here is my code. I start by authenticating the local player: GKLocalPlayer.localPlayer.authenticateHandler= ^(UIViewController

Game Center InviteFailed

一笑奈何 提交于 2020-01-11 08:50:34
问题 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 回答1: As far as I am aware you cannot test multiplayer in the simulator. You will need two devices. 回答2: Even though the invite functionality doesn't work in the simulator, you can still