ios,game-center,gkturnbasedmatch
Quick google search turned this up. http://www.raywenderlich.com/60980/game-center-tutorial-how-to-make-a-simple-multiplayer-game-with-sprite-kit-part-1...
ios,parallel-processing,ios8,thread-safety,game-center
I've tried combinations of the following remedies: throttle to only one or few parallel requests enforce delay between requests repeat requests for a number of times until leaderboards is no longer nil A combination of throttling to only 1 "parallel" request and repeating requests up to 2 times proved effective...
ios,facebook,swift,game-center,facebook-ios-sdk
Are your settings in Settings | Facebook current so that you are authenticated? FWIK that should be all there is to it.
swift,sprite-kit,game-center,game-center-leaderboard
First you must authenticate the player: var localPlayer = GKLocalPlayer.localPlayer() localPlayer.authenticateHandler = {(viewController : UIViewController!, error : NSError!) -> Void in if ((viewController) != nil) { self.presentViewController(viewController, animated: true, completion: nil) }else{ println((GKLocalPlayer.localPlayer().authenticated)) } } Then you can open the leaderboard: func showLeaderboard() { var gcViewController: GKGameCenterViewController = GKGameCenterViewController() gcViewController.gameCenterDelegate...
ios,unity3d,game-center,game-center-leaderboard
In short: no. Access to Game Center has to go through the GameKit.framework which is only available on iOS and OS X. Furthermore, players need to be authenticated. Therefore a single server can't send scores etc. on behalf of the players even if it were running on OS X because...
ios,objective-c,xcode,game-center
GKScore has a "value" property, which is a "int64_t". Why not set the ".value" property of your "score" object to "g_nScore"?...
ios,objective-c,xcode,game-center
In Addition to @Raptor's answer try following. [self.window.rootViewController presentViewController:viewController animated:YES completion:nil]; ...
For iOS 7: https://developer.apple.com/game-center/images/game-center-hero.png For iOS 6: http://devimages.apple.com/iphone/gamecenter/images/hero-gamecenter.jpg I just found these on apples website. I've use the iOS 7 one before and my app was approved but don't hold me to Apple approving your app using their exact image....
It could at best take around 15 milliseconds send data.
ios,lua,corona,game-center,game-center-leaderboard
The score must be an integer even if you set up a Fixed Point - To 3 Decimals. If you submit 1234 you would get 1.234 To fix you problem, just multiply your score with 1000 and then submit....
ios,xcode,game-center,gkturnbasedmatch
I found what was the issue after many days of searching and testing everything. The problem was with quitting and then removing a match, the removeWithCompletionHandler: was inside the participantQuitInTurnWithOutcome: and somehow these actions would log out the player from game center without any notice, and the odd thing was...
Crash in objc_msgSend can indicate that message destination object is deallocated already. Try to enable zombie objects and keep your eyes on logs.
ios,objective-c,core-data,game-center,nsincrementalstore
Educated guess, because it's an implementation detail: The p means something like permanent, because the object has been saved to the store. i.e. [objectID isTemporaryID] == NO. It'll be a t if the objects hasn't been saved yet. i.e. [objectID isTemporaryID] == YES. ...
ios,objective-c,xcode,game-center,int64
NSInteger and long are always pointer-sized. That means they're 32-bits on 32-bit systems, and 64 bits on 64-bit systems. Under mac os uint64_t defined as typedef unsigned long long uint64_t; So, i recommend you to change highscorenumber to NSUInteger and save it to NSUserDefaults as [[NSUserDefaults standardUserDefaults] setValue:@(highscorenumber) forKey:@"highscoresaved"]; EDIT:...
TLDR: Yes, they'll transfer. When you submit an update for your app, any existing leaderboards and achievements that have been approved in previous versions will carry over to the new version. The reason it says "You don't have any new leaderboards for this app" is because you probably haven't added...
Here is a quote from authenticateHandler documentation The authenticate handler will be called whenever the authentication process finishes or needs to show UI. The handler may be called multiple times. Authentication will happen automatically when the handler is first set and whenever the app returns to the foreground. If the...
ios,game-center,xcode7,swift2,game-center-leaderboard
According to the prerelease documentation, the method signature has changed to be: class func reportScores(_ scores: [GKScore], withCompletionHandler completionHandler: ((NSError?) -> Void)?) This differs from the old documentation which stated: class func reportScores(_ scores: [AnyObject]!, withCompletionHandler completionHandler: ((NSError!) -> Void)!) Note the change to an optional NSError parameter as well...
ios,objective-c,sprite-kit,game-center,game-center-leaderboard
I've had this issue before and after much searching it seems to be an error with sandbox accounts. I split my table into highest of all time, highest today and highest friend and in each case other higher scores from my other sandbox accounts were ignored. When I added another...
Try: loadFriendPlayersWithCompletionHandler:
playerIDs are ordinary NSStrings. You should not make assumptions about a particular encoding at this level. But you can get the UTF8-representation with UTF8String.
swift,sprite-kit,game-center,gamekit,game-center-leaderboard
Include the GKGameCenterControllerDelegate protocol within your class. class ViewController: UIViewController, GKGameCenterControllerDelegate This method dismisses the Game Center view when "Done" is tapped: func gameCenterViewControllerDidFinish(gcViewController: GKGameCenterViewController!) { self.dismissViewControllerAnimated(true, completion: nil) } This function includes the code that is needed to display the leaderboard: func showLeaderboard() { // declare the Game Center...
ios,swift,sprite-kit,game-center,gamekit
Make sure you have included the GKGameCenterControllerDelegate protocol within your class. class ViewController: UIViewController, GKGameCenterControllerDelegate{ ... } That delegate requires a method which will be executed when the player taps on "Done". func gameCenterViewControllerDidFinish(gcViewController: GKGameCenterViewController!) { self.dismissViewControllerAnimated(true, completion: nil) } This is the function that includes the code needed to...
So I was obviously being dumb. Once the Game Center is enabled in the Update on iTunes Connect, it says: "You don't have any new leaderboards for this app." The key word being: "You don't have any new leaderboards for this app.", thus assuming your update doesn't include any new...
swift,sprite-kit,itunesconnect,game-center,game-center-leaderboard
Firstly add the GKGameCenterControllerDelegate to your class: class viewController: UIViewController, GKGameCenterControllerDelegate { ... } This is the code you need to use to authenticate the player: func login() { println("Game Center Login Called") let localPlayer = GKLocalPlayer.localPlayer() // Handle the authentication localPlayer.authenticateHandler = {(Home: UIViewController!, error: NSError!) -> Void in...
ios,sprite-kit,game-center,viewcontroller,skscene
yes there is a way, you can call this code directly from -(void)showGameCenter: UIViewController *vc = self.view.window.rootViewController; [vc presentViewController: gameCenterController animated:YES completion:Nil]; ...
You create a test user by logging into iTunesConnect, and clicking on Manage Users. You can then select from creating an "iTunesConnect User" or a "Test User". Reference: iTunesConnect Developer Guide - Test User accounts...
Well seems that there is a lag (1-2 days) while boards have this problem. After some time passes all leaderboards behave as intended.
ios,objective-c,for-loop,iteration,game-center
You can make a variable outside of the loop, and in each iteration, var+=score.value. Therefore after the iteration, the variable you build will contain the total score.
The score parameter is an integer, so you should be tracking the number of seconds as the score, not the number of minutes: int score = 2 * 60 + 22; // 142 seconds = 2m22s Reference...
It is actually possible to address this issue in a rather simple way, although it was not so evident what to look for. The Game Center Programming guide actually states that "You can create distinct games (with different bundle identifiers) and still allow them to play against each other." So...
I suppose that if you switch to the Game Center app and log in there all will be good. After a third unsuccessful login attempt in GKGameCenterViewController (i.e. your app) that is normally required.
ios,objective-c,itunesconnect,game-center
A leaderboard cannot be reset daily. However, you may query for results during the last day / week / etc. This is explained here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/LeaderBoards/LeaderBoards.html You may show data filtered by possible properties, such as timeScope: You set properties on the GKLeaderboard object to filter which scores are returned to...
unity3d,system,game-center,require
The minimum spec is not a hard and fast rule of the engine but something that you find through testing. The best way to set the min spec is to actually run the game on various older machines and see how it holds up. You can use that testing to...
ios,objective-c,cocos2d-iphone,game-center
I believe what you are looking for is the leaderboardDelegate property rather than the delegate property. leaderboardDelegate requires a <GKLeaderboardViewControllerDelegate> while delegate requires a <UINavigationControllerDelegate>, hence the error message. Check the apple docs for leaderboardDelegate https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKLeaderboardViewController_Ref/#//apple_ref/occ/instp/GKLeaderboardViewController/leaderboardDelegate...
iphone,authentication,swift,ios8,game-center
I resolve by myself. code this : var localPlayer = GKLocalPlayer.localPlayer() instead of : var localPlayer = GKLocalPlayer()...
Finally solved this. Do not attempt to edit the match object. Don't directly edit the matchData, or any other component of the match. Create a copy, do whatever you need to do to the copy and resubmit the copy. My attempt to sort the players produced all sorts of erratic...
ios,game-center,game-center-leaderboard
Yes. Your app is most likely to be rejected, and you will have a message in the Resolution Center asking you to enable the Game Center entitlement. So don't lose more time and do it now.
Okay, I have gone back and rewritten the code as follows: func displayGameMaker(){ if (GKLocalPlayer.localPlayer().authenticated){ var request = GKMatchRequest() request.minPlayers = 2 request.maxPlayers = 2 request.inviteMessage = "You have been invited to a game!" var vc = GKMatchmakerViewController(matchRequest: request) vc.matchmakerDelegate = self self.showViewController(vc, sender: self) } } So, if anyone...
sprite-kit,game-center,game-center-leaderboard
I solved it via editing exception breakpoint from all to Objective-C exceptions . Tnx @LearnCocos2D for the answer
Suppose you have player ids in friendsArray. Then try this: GKFriendRequestComposeViewController *friendRequestViewController = [[GKFriendRequestComposeViewController alloc] init]; friendRequestViewController.composeViewDelegate = self; [friendRequestViewController setMessage:@"Add your message here"]; if (friendsArray) { [friendRequestViewController addRecipientsWithPlayerIDs: friendsArray]; } [self presentModalViewController: friendRequestViewController animated: YES]; Hope this helps.. :)...
As long as the app itself is in the foreground, you can fire a notification every xx seconds which handles the background tasks. When the full app goes into background, you only have a limited amount of time to close actions....
Looks like there isn't a way. But the next best thing for me is to let people press 'play now' and then hit them with a message box that says 'No' - you have to invite people and that looks like this. - (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match { if(_matchRequest.playersToInvite ==...
ios,app-store,game-center,robovm
Even though I don't know why,but the problem was solved.May be there is something wrong with apple
ios,ios8,game-center,nsoperationqueue,nsurlerrordomain
For some reason this alternative call does not lead to errors: GKLeaderboard *leaderboard = [[GKLeaderboard alloc] initWithPlayers:@[ GKLocalPlayer.localPlayer ]]; leaderboard.identifier = leaderboardIdentifier; leaderboard.timeScope = GKLeaderboardTimeScopeAllTime; [leaderboard loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { // ... }]; Problem solved....
ios,objective-c,c,multithreading,game-center
You should use GCD. It's clean and thread-safe. dispatch_group_t group = dispatch_group_create(); //Create the group [GKPlayer loadPlayersForIdentifiers:playerIds withCompletionHandler:^(NSArray *players, NSError *error) { for (GKPlayer *player in players) { dispatch_group_enter(group); //For each element, enter the group [player loadPhotoForSize:GKPhotoSizeSmall withCompletionHandler:^(UIImage *photo, NSError *error) { dispatch_group_leave(group); //Leave group when the operation is done...
Finally I have figured out the solution which works. I had to implement the GKLocalPlayerListener like this and call the match for invite within the delegate function. func player(player: GKPlayer!, didAcceptInvite invite: GKInvite!) { GKMatchmaker.sharedMatchmaker().matchForInvite (invite, {(InvitedMatch, error) in if InvitedMatch != nil { myMatch=InvitedMatch LocalGame=false if let scene =...
ios,nsdata,32bit-64bit,game-center
You could for example look at NSJSONSerialization, which allows you to convert any dictionary or array containing dictionaries, arrays, numbers, strings, and NSNull values to NSData in a 100% portable way. There is one method turning dictionary or array into NSData, and another to turn NSData back into the exact...
objective-c,nsarray,iteration,nsdictionary,game-center
Your method can be cleaned up by using callback blocks. typedef void(^CallbackBlock)(id object); //callback accepts an NSArray* of GKScore* - (void)loadScoresForLeaderboardID:(NSString *)leaderboardID range:(NSRange)range callback:(CallbackBlock)callback { GKLeaderboard *myLB = [[GKLeaderboard alloc] init]; myLB.identifier = leaderboardID; myLB.timeScope = GKLeaderboardTimeScopeAllTime; myLB.playerScope = GKLeaderboardPlayerScopeGlobal; myLB.range = range; [myLB loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { if...
ios,swift,asynchronous,block,game-center
You would put it in the completion block of loadScoresWithCompletionHandler: leaderboardRequest.loadScoresWithCompletionHandler({ (scores:[AnyObject]!, error:NSError!) -> Void in if (error != nil) { println("error in leaderboard highscore request") println(error.description) } else { self.leaderboardReceived = leaderboardRequest // Your data-presenting code goes here: self.tableView.reloadData() } }) ...
No. You must use a sandbox account until it is approved by apple. It is very simple to create sandbox accounts with iTunes Connect though. Just go to your Users and Roles -> Sandbox Testers -> Plus button. Simply create a sandbox account with a working email that is not...
ios,xcode,swift,game-center,game-center-leaderboard
You can choose arbitrary (unique) strings as leaderboard IDs and assign them in iTunes Connect. Mine look like this: leaderboard.identifier = "com.domain.app.leaderboard". ...
cocoa-touch,game-center,testflight
They can use their normal accounts, but they have to have sandbox mode turned on under Game Center in their settings. This will create a new sandbox account for them using their normal account. Apples developer guide says: Important: If your app uses Game Center, testers will be required to...
This version for encapsulating an Int (or other type) into or extracting it fromNSData should work even between devices with different byte orders: // at sender before sending data let data = NSMutableData() let archiver = NSKeyedArchiver(forWritingWithMutableData: data) archiver.encodeInteger(score, forKey: "score") archiver.finishEncoding() // at receiver after receiving data let unarchiver...
This code updates successfully the local score that, in my code, is an Int value called score. func compareLocalHighScoreFromLeaderboards() { println("Function called!") let leaderboardRequest = GKLeaderboard() leaderboardRequest.identifier = "Best_Score" leaderboardRequest.loadScoresWithCompletionHandler { (scores, error) -> Void in if error != nil { println("Error fetching score from leaderboards: \(error))") } else if...
So, in your GKMatchmakerViewControllerDelegate method, you should just be able to do something like the following: func matchmakerViewController(_ viewController: GKMatchmakerViewController!, didFindMatch match: GKMatch!) { let teamChannel = match.voiceChatWithName("redTeam") let allChannel = match.voiceChatWithName("allPlayers") // use the channels above } ...
Finally i got output by below code... - (void) incrementAchievementThis:(NSString*)achievementID :(NSInteger) incStep { [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { if (error == nil) { for (GKAchievement* achievement in achievements) { if ([achievementID isEqualToString:achievement.identifier]) { achievement.percentComplete += incStep; [GKAchievement reportAchievements:@[achievement] withCompletionHandler:^(NSError *error) { if (error != nil) { NSLog(@"Error at incrementAchievementThis()");...
No, you don't need to implement all features. But for the most part challenges are handled automatically if you have set up achievements or leaderboard scores. Game Center will send your app messages about challenges (if it is in the foreground), but in general it handles the outcome without your...
objective-c,game-center,gkturnbasedmatch
This is possible with the playerGroup property of a GKMatchRequest. When you assign it to the request it will create a match only if it can find another player with a match request of the same group. Read GKMatchRequest Class Reference for more information.
In your view controller implement the GKGameCenterControllerDelegate Create a local player var localPlayer: GKLocalPlayer = GKLocalPlayer.localPlayer() Authenticate the player in the viewDidLoad with the game center and present the authentication success localPlayer.authenticateHandler = {(ViewController, error) -> Void in if((ViewController) != nil) { self.presentViewController(ViewController, animated: true, completion: nil) } }...
ios,iphone,itunesconnect,game-center
The Achievements will continue to work, but they will be reset for all existing users of the old version of the app. Any achievements that users of the old version had will be gone.
network-programming,game-center,distributed,middleware,distributed-system
Yes there are plenty ... There are two things you need to think about: In which format do you want to transfer the data: text (XML, JSON) Binary (Protocol Buffers, ...) How do you want to communicate with the server HTTP (REST, WEB Services, ...) Messaging (ZeroMQ, ...) other protocols...
You check it like this: if([GKLocalPlayer localPlayer].isAuthenticated) { // user logged in } ...
//Rate Button if ([node.name isEqualToString:@"rateButton"]) //Your Rate Button name { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/app/id919770861"]];//itms-apps://itunes.apple.com/app/idYourAppID } //Game Center Button - (void)showGKGameCenterViewController: (UIViewController *)viewController { if (!_enableGameCenter) { NSLog(@"Local play is not authenticated"); } GKGameCenterViewController *gameCenterViewController = [[GKGameCenterViewController alloc] init];...
Game center is known to have issues with updating data while in the sandbox, developers get the lowest priority on the server. Try testing your code in an off-peak time (mornings and the middle of the night worked best for me) The other thing you can do is submit your...
This is not possible with GameKit. Players data is read-only and can be changed in Settings app only. Source: GKPlayer Class Reference.
sprite-kit,game-center,leaderboard,game-center-leaderboard
presentModalViewController was deprecated in iOS 6. GKLeaderbardViewController is deprecated in iOS 7. You an refer to this: What should I use instead of deprecated GKLeaderboardViewController in iOS7?...
ios,game-center,country,leaderboard
The Game Center views do not offer filtering other than what you see in the standard interface (time scope and all players vs. all friends). So, to get this behavior, you would need to build your own custom Game Center leaderboard interface, manually downloading scores with GKLeaderboard, and storing and...
ios,game-center,gkturnbasedmatch
In order to solve this problem, I had to programmatically load the match data to force the matchOutcome of player 2 to switch to the state of "Won". So, instead of immediately calling rematchWithCompletionHandler when the user affirms the prompt for a rematch, I do the following when they affirm...
ios,objective-c,game-center,gamekit
The iPhone 5 uses uses an Apple A6 (32-bit), the iPhone 5S an Apple A7 (64-bit) processor. You need to encode/decode NSData that is sent between players in a portable representation, such as can be obtained with NSKeyedArchiver/NSKeyedUnarchiver for encoding/decoding NSIntegers, etc. You are currently sending structs whose representation is...
cocos2d-x,real-time,game-center,invite,gkmatchmaker
GKMatch property was set to (assign) and was needed to change to (retain) GKMatch object needed to be initialized to nil at start so it could be used ...