game-center

How to fetch top 10 scores from a specific gamecenter leaderboard with swift (iOS)

戏子无情 提交于 2019-12-10 19:20:27
问题 How to fetch top 10 scores from a specific gamecenter leaderboard in swift (iOS)? I'd like to fetch top 10 scores and players from leaderbaord and build a custom "HALL OF FAMES" in game. How to fetch datas from leaderbaord? 回答1: Meanwhile i found an answer: let leaderBoardRequest = GKLeaderboard() leaderBoardRequest.identifier = kGcIdHighScore // my GC Leaderboard ID leaderBoardRequest.playerScope = GKLeaderboardPlayerScope.Global leaderBoardRequest.timeScope = GKLeaderboardTimeScope.AllTime

Handle Selected Turns/Games in iOS Game Center App in Game Center Enabled App

百般思念 提交于 2019-12-10 18:49:53
问题 I am creating a GKTurnBasedMatch Game Center-enabled app. I've successfully implemented GKLocalPlayerListener methods to listen for events, such as player:receivedTurnEventForMatch:didBecomeActive: and other methods. Additionally, if a user taps on an existing match in the GKTurnBasedMatchmakerViewController (for example, if showExistingMatches is set to YES ), I can handle the event in the GKTurnBasedMatchmakerViewControllerDelegate method turnBasedMatchmakerViewController:didFindMatch: .

Game Center Invitation handler, Where does it belong?

好久不见. 提交于 2019-12-10 18:07:28
问题 I already searched the site and found this: GameCenter Invitation Handler He says: " As stated in the docs Your application should set the invitation handler as early as possible after your application is launched; an appropriate place to set the handler is in the completion block you provided that executes after the local player is authenticated. " .. OK, that's cool, but! I would like Authenticate the player ONLY if an invitation was received .. Example: Scenarios: The player launches the

Game Center leaderboard score - “20points” instead of “20 points”

て烟熏妆下的殇ゞ 提交于 2019-12-10 16:24:56
问题 I'm currently testing Game Center leaderboards for my app. Everything's working fine with authenticating and submitting scores, but when I go to look at the leaderboard in Game Center, it says "200points" instead of "200 points". Why isn't there a space between the score and the score type? And how can I fix it? Thanks! 回答1: So, since I understand that more people experience the same problem, and adding space in front of the label as the accepted answer suggests, does not seem to work, I

about percentComplete in GKAchievement

老子叫甜甜 提交于 2019-12-10 13:57:35
问题 After testing, I find that though the type of percentComplete of GKAchievement is double, and in apple's help document the legal values is between 0.0 and 100.0. but if you report percentComplete=1.5 to apple server, next time you will get the value percentComplete=1.0(another example, report 0.5, get 0.0). So I just think this may be a bug of percentComplete. Now our project has some achievements need be accumulated, like finish 200 times of play, we don't save the value in local, but report

Game Center leaderboard shows one result

牧云@^-^@ 提交于 2019-12-10 11:36:09
问题 I've sent scores to the leaderboard with different test accounts but when I try to see the leaderboard I can only see the score from the account that I'm logged in. I used this code to send the scores : - (void)reportScore:(int64_t)score forLeaderboardID:(NSString*)identifier { GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: @"GHS"]; scoreReporter.value = score; scoreReporter.context = 0; [GKScore reportScores:@[scoreReporter] withCompletionHandler:^(NSError *error) {

Game Center sandbox losing scores

二次信任 提交于 2019-12-10 11:13:49
问题 I'm testing Game Center leaderboards in my App and my scores seem to be disappearing after a while. I had 3 different sandbox accounts creating high scores one night, and then the next morning, they were all gone. All my categories were empty. Does Apple reset these periodically? Or is there something else going one? Are there several sandbox servers? 回答1: OK, this turned out to be an Apple bug. I filed a bug report and it was fixed a day later. 来源: https://stackoverflow.com/questions/7261994

Login in iPhone App via GameKit

大憨熊 提交于 2019-12-10 10:52:11
问题 I want to login to my app via GameCenter Login API. Is it possible ? Is Apple game Center login API public? 回答1: If you're using iOS 6, see the documentation for GKLocalPlayer. You'll see that you assign a block to the 'authenticateHandler' property of localPlayer. When you assign it, if the player isn't already logged into Game Center, one of the arguments to the block (UIViewController *viewController) gets filled in with the address of a view controller that will present the regular Apple

Updating the matchData in a GKTurnBasedMatch without ending the turn

旧巷老猫 提交于 2019-12-09 18:38:27
问题 It seems that GameKit only allows GKTurnBasedMatch to be updated once per time that GKTurnBasedMatch is loaded from the Game Center servers. Is there an other way to update the matchData property? 回答1: The following method was added to GKTurnBasedMatch in iOS 6.0 and will do what you need: - (void)saveCurrentTurnWithMatchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler "Update the match data without advancing the game to another player" 回答2: You can call

Update a score already submitted to Game Center

假如想象 提交于 2019-12-09 14:45:52
问题 Right now I am working on a Black Jack game for iOS and would like to have a leader board that shows which players currently have the most "money". So if they get a high score and then lose "money" it would update their high score to match the users current amount of money, which would be less than before. Is there any way to do this with Game Center? 回答1: Things have changed since iOS7. Now you can change the "Score Submission Type" to "Most Recent Score" instead of "Best Score". This is an