Menu
  • HOME
  • TAGS

Game Center - Turned Base Tutorial

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...

Maximum number of outstanding loadLeaderboardsWithCompletionHandler: from a single iOS client?

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...

Enable Facebook Like Button in Game Center

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.

how do I implement GameCenter Leaderboard? [closed]

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 GameCenter: Send scores from server

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...

Is there a way to store int value in object GKScore?

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"?...

Authenticate player ios app

ios,objective-c,xcode,game-center

In Addition to @Raptor's answer try following. [self.window.rootViewController presentViewController:viewController animated:YES completion:nil]; ...

GameCenter icon for use in App

ios,xcode,icons,game-center

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....

How long does it take sending and receiving data using Gamecenter real time multiplayer?

ios,objective-c,game-center

It could at best take around 15 milliseconds send data.

Corona SDK - iOS Game center score error, decimal comma

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....

Game Center - turn based game issue

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...

EXC_BAD_ACCESS when allocating an NSMutableArray

ios,objective-c,game-center

Crash in objc_msgSend can indicate that message destination object is deallocated already. Try to enable zombie objects and keep your eyes on logs.

Where does extra 'p' in NSManagedObjectID come from?

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. ...

How can i equal a int to a int64_t with out getting the conversion loses integer precision warning?

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:...

when i update my game in iTunes connect will the leaderboards carry over?

ios,itunesconnect,game-center

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...

IOS Game Center: How to know when default sign in form for game center is finished?

ios,objective-c,game-center

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...

Saving a highscore for Game Center in Swift 2

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...

Game Center leaderboard shows one result

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...

how to programmatically find game center friends in IOS 8

ios,game-center,gamekit

Try: loadFriendPlayersWithCompletionHandler:

are playerIDs in Game Center utf8

ios,utf-8,game-center

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.

Displaying a Game Center Leaderboard in SpriteKit

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...

Swift Displaying Game Center Leaderboards

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...

Game Centre Integration with App Updates - iTunes Connet

ios,itunesconnect,game-center

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...

Connecting Itunes Connect To Code For GameCenter Leaderboard

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...

show GKGameCenterViewController in SKScene

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]; ...

Is test player for Apple Game Center done as for real user?

ios,game-center

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...

Several Leaderbords in sandbox mode

ios,swift,game-center

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: Iterating Through Scores & Adding Them Up?

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.

How To submit my time of win game in game center in ios

ios,game-center

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...

Matches across different apps of a Game Center group

objective-c,game-center

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...

keep on getting error in gamecenter authantication with ios8.1

ios,game-center,ios8.1

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.

Is it possible to create day/week/month leaderboard using Game Center?

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...

How can I get the minimum/recommended system requirements for my game?

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...

Game Centre Leaderboard - Can't set GKLeaderboardViewController delegate to self (CCLayer)

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...

How authenticate a local player with swift?

iphone,authentication,swift,ios8,game-center

I resolve by myself. code this : var localPlayer = GKLocalPlayer.localPlayer() instead of : var localPlayer = GKLocalPlayer()...

GameCenter: endTurnWithNextParticipants not advancing

ios,game-center,ios8.1

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...

Game Center entitlement

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.

Error initializing GKMatchMakerViewController

ios,swift,game-center,gamekit

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...

Undefined behaviour of GameCenter leaderboards with SpriteKit

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

Send GameCenter friendrequest

ios,objective-c,game-center

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.. :)...

iOS8 : running in the background for forever : GameCenter

ios,game-center

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....

How do you disable the “Play Now” ballon from appearing in the GKMatchmakerViewController

ios,game-center

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 ==...

Rank in Game Center dosn't appear in current version?

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

NSURLErrorDomain code=-1005 from GKLeaderboard loadScoresWithCompletionHandler:

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....

Objective-c: Return when all threads are done

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...

How to accept Game Center invite in swift

swift,game-center

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 =...

Sending NSDATA from 32bit to 64bit in multiplayer game using Game centre in ios

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...

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

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...

How to present data provided by asynchronous call on UI in Swift?

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() } }) ...

(iOS 8)Can I use Real Game Center Account to test an iOS app?

ios8,game-center

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...

How to Implement Game Center Leaderboard ID in swift

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". ...

Using TestFlight with Sandbox mode?

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...

How do I send data from a GKPlayer to another in a match?

ios,swift,game-center

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...

How do I retrieve a score from a leaderboard in iOS?

ios,swift,game-center

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...

How do I migrate this GKVoiceChat code to Swift?

ios,swift,game-center

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 } ...

How to retrieve Game center's achievement percentage and submit back with modification?

ios,game-center

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()");...

Game Center challenges feature

ios,game-center

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...

Game Center Turn Based matches. Multiple type match inside one game?

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.

GameCenter Integration with SpriteKit

ios,swift,game-center

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) } }...

Will moving existing Achievements to a Group make old app version malfunction?

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.

Cross Language Middlewares

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...

Check if a game center account is logged in

ios,game-center,gamekit

You check it like this: if([GKLocalPlayer localPlayer].isAuthenticated) { // user logged in } ...

Game center issue

game-center

//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];...

GameCenter high scores doesn't include recently set score

ios,swift,game-center

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...

How to change user alias on game center programmatically?

objective-c,game-center

This is not possible with GameKit. Players data is read-only and can be changed in Settings app only. Source: GKPlayer Class Reference.

GKLeaderboard in SpriteKit?

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?...

Rank different countries in Game Center Leaderboard?

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...

Proper GKTurnBasedMatch End Of Match When participantQuitOutOfTurnWithOutcome

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...

Data gets messed up when sent between two devices

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...

EXE_BAD_BADACCESS trying to access GKMatch?

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 ...