Author Topic: Anyone willing to share their Game Center Code?  (Read 6300 times)

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Anyone willing to share their Game Center Code?
« on: March 11, 2013, 08:52:15 pm »
I'm adding Game Center to an app and was wondering if anyone would be willing to share their Game Center Code on the forum? I'm only interested in Leader Board Rank and score posting but I'm sure others would find the other stuff useful also. Thanks
EricB

 

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #1 on: March 12, 2013, 06:34:41 am »
I'm going to be implementing it in my next game. When I have it working I'll definately post it up.. Probably somewhere around the weekend

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #2 on: March 12, 2013, 11:46:02 am »
Thanks I also got a response from Kaiji (who wrote TicTacPop). He said he basically followed the Dragonfire docs , used GameCenterLeaderboardPostScore and GameCenterInit(OnGameCenter) and that's all. He also said the trickiest part was setting up the LeaderBoard with the apple account. I was wondering if it necessary to check for errors and respond to them?
Ericb

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #3 on: March 12, 2013, 06:05:12 pm »
Thanks I also got a response from Kaiji (who wrote TicTacPop). He said he basically followed the Dragonfire docs , used GameCenterLeaderboardPostScore and GameCenterInit(OnGameCenter) and that's all. He also said the trickiest part was setting up the LeaderBoard with the apple account. I was wondering if it necessary to check for errors and respond to them?
Ericb


If you could, and he agrees. Can you post the code publicly? I would love to see it. It would save me time and im sure for many others too... :)

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #4 on: March 24, 2013, 10:15:22 am »
Did you ever get the LeaderBoard going in your app? I followed Kaiji's advice and it was that simple. Setting up the Leaderboard in gamecenter wasn't that difficult, then I just used GameCenterInit(OnGameCenter) in AppMain, GameCenterLeaderboardPostScore() in my gameover function, then made a button that called the GameCenterLeaderBoardShow() command. I also checked for a flag in the OnGameCenter callback and if a flag was set I called the command AlertShow("Game Center Error!", "An error has ocurred. Be sure that you are logged or you have internet connection.") . I also setup seperate Leaderboards for when you play the game in easy mode or hard mode. One thing I should note is that when testing in Sandbox, your score will show up right away (as Me) but other account scores took hours before they showed up.
EricB

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #5 on: March 25, 2013, 05:33:39 pm »
Did you ever get the LeaderBoard going in your app? I followed Kaiji's advice and it was that simple. Setting up the Leaderboard in gamecenter wasn't that difficult, then I just used GameCenterInit(OnGameCenter) in AppMain, GameCenterLeaderboardPostScore() in my gameover function, then made a button that called the GameCenterLeaderBoardShow() command. I also checked for a flag in the OnGameCenter callback and if a flag was set I called the command AlertShow("Game Center Error!", "An error has ocurred. Be sure that you are logged or you have internet connection.") . I also setup seperate Leaderboards for when you play the game in easy mode or hard mode. One thing I should note is that when testing in Sandbox, your score will show up right away (as Me) but other account scores took hours before they showed up.
EricB

no I havent, I have been very focused on other things. Thanks for the advice! Greatly appreciated! What do you mean by SandBox? Emulator?

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #6 on: March 25, 2013, 09:10:47 pm »
I get an error :/ it says "The game is not recognized by game center" and it seems like I did everything correctly :/

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #7 on: March 26, 2013, 02:44:15 pm »
Sandbox is just like the game center but only used for testing apps.  did you add a leaderboard or achievement to your app in itunes connect? Did you get a Adhoc mobileprovision file from apple and then give that to Dragonfire so they can put it on the build center server? If not your build center builds will not work on gamecenter.


glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #8 on: March 26, 2013, 05:25:08 pm »
Sandbox is just like the game center but only used for testing apps.  did you add a leaderboard or achievement to your app in itunes connect? Did you get a Adhoc mobileprovision file from apple and then give that to Dragonfire so they can put it on the build center server? If not your build center builds will not work on gamecenter.

Yea I just sent them the files... I didn't know I had to do that. I hope it will work :) thanks for the advice and help!!

Damian G

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #9 on: March 30, 2013, 01:26:07 pm »
Hey EricB,

When you submit a score and then call the show leaderboard command, does that score appear there? I have been sitting on this one for a day now and yet nothing is appearing no matter what I do...

my result when posting is as following: "Score Post event result: value: 1 desc:com.******.*****.level1"
in other words the result is never success... :( I tried changing the bundle id from caps to lower case and so forth and its not working. When I request the leader board I get it but its empty....
« Last Edit: March 30, 2013, 02:09:28 pm by glina126 »

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #10 on: March 31, 2013, 06:47:32 pm »
I just made sure my Leaderboard id and my bundle id matched exactly as far as lower and upper case. Also Tim told me when you send your build to the build center it has to be the exact same name as the app name you used for you .mobileprovision file. When you look at the leaderboard your high score (whoever is logged on to gamecenter on your device), will show up as "Me". If you log in with a different account will see ""Me" for that high score and the other account names won't show up right away. It can take like a day befor the other people show up. Not sure why the delay but alot of people have mentioned this happens for them also. Good luck.
EricB

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #11 on: March 31, 2013, 08:40:18 pm »
I just made sure my Leaderboard id and my bundle id matched exactly as far as lower and upper case. Also Tim told me when you send your build to the build center it has to be the exact same name as the app name you used for you .mobileprovision file. When you look at the leaderboard your high score (whoever is logged on to gamecenter on your device), will show up as "Me". If you log in with a different account will see ""Me" for that high score and the other account names won't show up right away. It can take like a day befor the other people show up. Not sure why the delay but alot of people have mentioned this happens for them also. Good luck.
EricB

the problem is that my scores do not post at all. I can request the leader board and see it but its empty no matter how many times I post the scores..

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #12 on: April 01, 2013, 03:26:26 pm »
I assume your logged into the game center before you start your game right? When you load the game do you get a message that says "welcome back ( your game center nickname)...."? When you bring up the leaderboard in your app does it have the name of your app with icon in the leaderboard?
« Last Edit: April 01, 2013, 05:12:05 pm by EricB »

glina126

  • Guest
Re: Anyone willing to share their Game Center Code?
« Reply #13 on: April 01, 2013, 05:49:06 pm »
I assume your logged into the game center before you start your game right? When you load the game do you get a message that says "welcome back ( your game center nickname)...."? When you bring up the leaderboard in your app does it have the name of your app with icon in the leaderboard?

I created a new account using the sandbox interface. logged off and logged back on a million times. It always say welcome back glina... When I bring up the leaderboard it deos have the name of the app and the icon. I also tried creating challenges and they too show up as well as all the level leaderboards. I really dont know what to do anymore..

EricB

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Anyone willing to share their Game Center Code?
« Reply #14 on: April 01, 2013, 08:52:17 pm »
What does your LeaderPostScore command look like? Here is what I used "GameCenterLeaderboardPostScore("com.myname.PignOut2.myleaderboard1", points); " where "points" it the variable where I keep track of the score.