game-center

GKTurnBasedEventHandler delegate is not receiving any messages

僤鯓⒐⒋嵵緔 提交于 2019-12-06 13:34:17
I have used [[GKTurnBasedEventHandler sharedTurnBasedEventHandler] setDelegate:self]; but I am not receiving delegate calls. This was working at one point, and I can't figure out for the life of me what has changed. The app is properly badged (on the device home screen, it shows a badge with the number of games where it is my turn). Furthermore, using GKTurnBasedMatch loadMatchesWithCompletionHandler: is able to detect when it is the player's turn (or not). In fact, in every other conceivable way, GameCenter seems to be working perfectly. I can even send (and accept) challenges, but again, the

Game Center- handling failed achievement submissions?

耗尽温柔 提交于 2019-12-06 13:24:08
问题 Im a noob in game center @ games generally. Im making my second game now and implemented the game center. If the internet is available, there is no problem, everything works well. But just now I purposely make the internet unreachable, and when I get an achievement, obviously it does not register to the Game Center's Achievement. How and what's the best way to handle this issue? Thank you.... 回答1: You could add the GKAchievement objects that fail to register to an array and then resend them

Login in iPhone App via GameKit

半世苍凉 提交于 2019-12-06 13:05:59
I want to login to my app via GameCenter Login API. Is it possible ? Is Apple game Center login API public? 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 Game Center login screen. After you get that address you do presentViewController:viewController and the

Why does Social.localUser.Authenticate lead to crash when there is no internet connection in Unity app?

佐手、 提交于 2019-12-06 10:19:56
With an internet connection Everything works flawlessly. There is no memory problem leading to crash. With no internet connection The app proceeds to the menu screen, where it eventually crashes because it is out of memory. I have concluded that the problem lies in the following line of code Social.localUser.Authenticate When I comment out the above line, the memory problem goes away when there is no internet connection. Here is my relevant code void Start () { Social.localUser.Authenticate(ProcessAuthentication); } public void ProcessAuthentication(bool success) { if(success) Debug.Log (

Can Game Center integrate with non-game iOS application

ε祈祈猫儿з 提交于 2019-12-06 05:29:22
问题 I am working on an education application but I want to implement a leader board and achievement feature to it. So I come up with Game Center. My question is, this application is now in the education category and I don't want to move it to Game category. Will it be rejected in the application review because I integrate Game Center with a non-game application? 回答1: If your app is not a "Game" then it will not be allowed on the App Store if it integrates Game Center. See here... http:/

iOS Game Center Sandbox: Leaderboards show “No score”

久未见 提交于 2019-12-06 04:14:53
问题 So I am sending scores to the GC leaderboards, I receive no errors and the scores apprently send but I still see no scores listed in the leaderboards! The leaderboard itself is listed in Game Center there are just no scores. According to a Google search and a question on here this could be resolved by attempting to log scores with more than one account. I have tried on three different accounts now both in Simulator (iOS5) and on my iPhone; none of them show any errors when submitting the

Game Center integration with Sprite Kit?

允我心安 提交于 2019-12-06 03:34:30
How can I use Game Center or the GameKit Framework with a Sprite Kit Xcode template? In Sprite kit, it uses Scenes; but normally to view the leaderboards for example you need to "presentModalViewController" but that is not possible in SKView. And how can I authenticate the player and all that other fun stuff in iOS 6. Thanks in advance! you can authenticate like this [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { if (error == nil) { static_setEnable( true ); NSLog(@" Authenticate local player complete"); } else { static_setEnable( false ); NSLog(@

Handle invitation to GKTurnBasedMatch without game center view controllers

我与影子孤独终老i 提交于 2019-12-06 03:29:10
问题 I am working on a simple turn-based word game, and I'm having a difficult time figuring out how invitations are working. When user A invites user B to a game, I want user B to be able to see this game in my custom match interface (ie a screen where all of user B's games are listed). Things are fine if user B clicks on the notification when he is invited to a game, but I still want the game to be visible through my own interface if user B just navigates to the app on his own. Whenever this

Check if you've already unlocked an achievement in Game Center/GameKit

岁酱吖の 提交于 2019-12-06 02:15:38
I've been stumped on this for quite a long time. I understand how to unlock an achievement in Game Center and I even got a whole messaging system working. But I can't figure out how to check if an achievement has already been unlocked :( Apparently this doesn't work: GKAchievement *achievement = [[GKachievement alloc] initWithIdentifier:ident] autorelease]; NSLog(@"%i",achievement.completed); It always traces "0". Unlocking an achievement does work: GKAchievement *achievement = [[GKachievement alloc] initWithIdentifier:ident] autorelease]; achievement.percentComplete = 100; So it's not that I

Can I manually prompt the user to log in to Game Center on iOS 7?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 02:05:05
问题 According to Apple's Game Center programming guide, this code sets up an authentication handler. If you run this at the beginning of your game, the first time you run it , it will prompt the user to log in if they haven't yet. - (void)authenticateLocalPlayer { GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){ if (viewController != nil) { NSLog(@"Player not authenticated."); } else if (localPlayer