GameCenter LeaderBoards and Achievements Enabled Through OpenFeint

Today, we flip on the bit to allow your app to submit Leaderboards and Achievements to GamCenter from OpenFeint.

Pickup tomorrow's daily build and try it out.

I made the decision to put it out there for you to try it out before we had a chance to get docs, and sample code etc properly in place.

What I can suggest is to pay a visit to the OF forums or google Gamecenter support from Within OpenFeint for documentation. According to our findings, is as easy as setting an entry int the PList.

Let me know how it works out.

Obviously, sample code, docs, etc will be coming out soon, if you like to share your findings, our community will be very happy with your findings.

Carlos

Has anyone found exactly where to insert the Game Center enable switch?

According to http://support.openfeint.com/dev/game-center-compatibility/, it says to add [NSNumber numberWithBool:YES], OpenFeintSettingGameCenterEnabled, to the settings dictionary passed as parameters in Objective-C like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
  [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight],  
    OpenFeintSettingDashboardOrientation,
    @"OFTest", OpenFeintSettingShortDisplayName,
    [NSNumber numberWithBool:YES], OpenFeintSettingGameCenterEnabled, //<<<-- Just add this.
      nil
    ];
 
    [OpenFeint initializeWithProductKey:@"one_key"
      andSecret:@"MyString"
      andDisplayName:@"Testing App"
      andSettings:settings
      andDelegates:delegates
    ];

Ah, looks like the Release Notes were changed or I wasn't paying attention...

If the OFGameCenter.plist file is present, then the enable flag is automatically passed. Nice touch!

My game is officially Game Center enabled! Can't wait to submit it to the App Store as version 1.1!

oo sweet

I haven't bothered with daily builds up until now, but I think I'm gonna check out this drop.

@beyondthetch: You don't need to do any of that mumbo-jumbo obj-c. Its already taken care of it for you.

Carlos

No mumbo-jumbo?! What am I going to do with these tiki torches, pentagrams, and all this goat's blood?

That's Santeria chico ! Did you get the San Cristobal too? I may be able to round up some chickens by dawn...

Oh tasty,

I removed my app from the ITC review queue to put this in!

Its back in the queue now, with OF and GC included!!

Awesomesauce!

Wow ! awesome !

how easy was it to implement game center?

C.

I don't want to be Debbie Downer (http://tinyurl.com/cn9zmy) with all this excitement, Just out of curiosity, does a user have to sign in with OpenFeint in order to use Game Center? Are we still looking forward to a "direct" Game Center implementation and how soon?

right now you have to sign with OF but we will have a sep version of GC - but it is a win win with OF due to the fact that you can share scores blah blah with android users of your app ;-)

c.

>>but it is a win win with OF due to the fact that you can share scores blah blah with android users of your app ;-)

Huh? Did I miss something? Is Corona's Openfeint implementation now working on Android too?

It seemed to be pretty straight forward. I did some testing for it and I was able to get my achievements unlocking in both OF and GC, just by following the advice in the OF dev site (mainly to do with mapping the OF identifiers to the GC identifiers in the .plist file, and setting up all my leaderboards and achievements in GC to mirror how I had them in OF).

I actually didn't need to make any LUA code changes at all. All my OF calls just handled the GC as well.

In the long term I'd probably like to ditch OF and just use GC (I'm not building for Android yet, thats a headache I'm putting off for a while), but in the mean time this solution is fine.

Now if Apple would just get around to reviewing my game I could release the *expletive* thing!!

Just out of curiosity, does a user have to sign in with OpenFeint in order to use Game Center?

This morning I started testing Popz and I didn't have to sign in with OpenFeint for the GameCenter integration to work. I did of course have to sign in to GameCenter, so the exact chain of events was:

I launch app
OF screen appears, I decline
GC popup appears, I log in

Now I'm still unclear on how exactly all the integration points mesh together but I was planning to test that stuff this weekend.

ADDITION: oh wait when you guys talk of "signing in" to OpenFeint do you mean that you have to show the OF launch screen before using GameCenter? I declined it but I did see that screen. I do find that launch screen annoying, I don't want that to be the first thing people see when they start up my app.

Hi, guys,
I kept getting this message
"this game is not recognized by gamecenter"

though I've enabled gamecenter for my game in iTunes connect.
Any tips?

THX!

Just trying to get this working. I have taken the sample code from the openfeint site for the .plist file, but (without trying to sound stupid) I enter the OF numerical key, and the text name I gave my leader board in gamecenter, is that correct? My openfeint side still seems to be working but Im getting no score in gamecenter.

Is the .plist file the only file I need to create / edit?

Also, do I remove the other entry for a leaderboard if I only have one?

Thanks

Gaz

EDIT: My .plist file looks like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<plist version="1.0">
 
<dict>
 
  <key>Leaderboards</key>
 
  <dict>
 
    <key>6****4</key>
 
    <string>Greatest Hunters</string>
 
 
  </dict>
 
</dict>
 
</plist>

I've just realised that Openfeint highscore are now not submitting. Im guessing its because I have something wrong somewhere.

@gazjm : read my comment: right now you have to sign with OF but we will have a sep version of GC.

when we have GC by itself you will be able to do just that.

C

Thanks for the reply Carlos.

I am signing in with OF, it is now working ok, game center signs in, I go to gamecenter app and can see the sandbox leaderboard, but no data is sent to it when I get a high score. OF updates it's leaderboard but GC doesn't.

do I need the OFGameCenter.plist file at the moment? or does it just map my first OF leaderboard to my first GC leaderboard automatically?

sorry if this is simple to so but Ive got a brain freeze.

Gaz

Gaz,

Mapping between OF and GC is done in the plist file. Other than that, everything is automatic.

KC

Thanks, I just need to get my plist file correct then.

in the code I posted is it correct that the OF Id is the numerical id, and the GC Id is the name? Or is the GC id the numerical id number I assigned it.

Sorry again if this is simple to do. It's my final hurdle.

Gaz

I think you can use the same ID for GC. Unlike OF, you can enter the ID yourself. I added a prefix for GC, but I think that is not necessary. When you create leaderboards/achievements in GC, there is field for the ID.

Just FYI, I copied the ID codes that OpenFeint generated for each of my leaderboards and achievements and manually pasted them into my Game Center leaderboards and achievements as I created them.

Then you just use the exact same ID code in the plist file to link them up, and it saves the headache of maintaining two different ID codes per leaderboard/achievement.

I had this up and working in no time. Here is an example:

In this case, my leaderboard ID that OpenFeint generated for me was 638604, so in Game Center, I created a leaderboard and pasted that code into the Identifier field.

Same with achievements, OpenFeint generated the ID code 820992 for one of my achievements, so I created the same achievement in Game Center and pasted the code into the Identifier field.

--------------------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 
<plist version="1.0">
<dict>
  <key>Leaderboards</key>
  <dict>
    <key>638604</key>
    <string>638604</string>
  </dict>
  
  <key>Achievements</key>
  <dict>
    <key>820992</key>
    <string>820992</string>
  </dict>
</dict>
</plist>

thanks, that's just what indeed to know. I'll give it a try!

gaz

Should this work if my openfeint leaderboard is still in development mode?

I still can't get a score to appear in my gamecenter leaderboard at thats all I can think of that could be at fault.

My code is as below,

to submit my scores I have

1
2
3
4
5
6
7
8
lbID = "6****4"
numScore = settings.chasehighScore
 
function setHighScore()
openfeint.setHighScore( lbID, numScore)
end
 
timer.performWithDelay(500,setHighScore,1)      

Just realised Im still using xcode 3.2.5, could this have something to do with why it doesn't seem to work? Downloading xcode 4 now.

sorted now. I was being blind. My plist file was missing a < at the start.

Hi, could we get top 20 player by score and set new highscore to both OpenFeint and GameCenter by one or two httpd asyn request then display it manually with Corona?

I didn't include the OFGameCenter.plist, GameCenter support for the OpenFeint is enable by default ? How to disable it ?

You guys just keep making Corona more and more amazing. I can't wait to come play in your pond, right after I learn to swim.

Hi!
I am not signed up yet, I still have the trial of Corona. I have set up OpenFeint and am able to post scores to the server. Now I am trying to get it to connect to Game Center. I have created a new app in iTunes Connect (without uploading the app obviously:dev) and have activated Game Center support. I put in a Leaderboard and set its id to match the OpenFeint id for the same Leaderboard.
I even included the following OFGameCenter.plist:

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Leaderboards</key>
  <dict>
    <key>6****6</key>
    <string>Level 1</string>
  </dict>
</dict>
</plist>

gc is only available to subscribers at the moment .. u need access to daily builds...

c.

I am now a subscriber and have everything working. But I would like to bring back up the subject of logging in with OF in order to use GC. If a user declines the original message (or accepts and then logs out of OF) will both scores and achievements be posted to GC? If I decline, GC still pops up as logged in. But will data be posted in OF "offline mode?" Or must OF be "logged in" or accepted before GC can be used?
Sorry for the confusion. Thanks!

Hi,
I have a weird problem. GC seems to only get first hightscore into the leaderboard. OF works fine and records all the scores without any problems, but GC only first one...
Any ideas why it could be like that?...

Cheers

----------------

Hi got that sorted, it was just GC settings stuff. Just had to change to it sets hight score as the highest number :).

I would like to put a leaderboard to store Elo. This works fine in openfeint as there is a setting to allow worse scores. So the latest elo is stored in openfeint.
But this does not seem to work in game center. Is there a particular setting? Only the highest Elo score is stored.

Quick question.

Is this pList the same pList as the one I have in the build settings or a separate file?

My build settings has the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
plist =
                {
                        UIApplicationExitsOnSuspend = true,
                                                UIPrerenderedIcon = true,
                                                UIStatusBarHidden = true,
                        CFBundleIconFile = "Icon.png",
                        CFBundleIconFiles = {
                                "Icon.png",
                                "Icon@2x.png",
                                "Icon-72.png",
                                "Icon-Small-50.png",
                                "Icon-Small.png",
                                "Icon-Small@2x.png"
                        }
                },

I'm pretty sure it is supposed to be a plist as a separate file named: OFGameCenter.plist

Ah great - thanks sparky - it is so difficult finding any documentation on this on the Corona site:)

I think i have nearly got this up and running but one question.

Prior to implementing this, I had one game appearing in Game Center (Angry Birds Free)

When I tested my game, it displays a screen titled "Sign in to Game Center" however it has *** Sandbox *** below this title

When I choose use existing account when I then leave my game and go to game center I see my game Ball Frenzy listed in Game Center but Angry Birds is no longer there

Possibly this is due to the fact I am testing an adhoc version?

Hopefully this is the case and I can get an update of my game on iTunes as soon as possible with this great new feature

To my knowledge, no other games but those being tested by a specific developer (you) should appear in Sandbox Mode.

Ah OK that probably explains it. Cool - this is a really nice addition!!! Thank you Ansca:)

One more quick question - what will the minimum spec be for my game now that Game Center is included?

I didn't include the OFGameCenter.plist, GameCenter support for the OpenFeint is enable by default ? How to disable it ??????????

There are any options to provide in the openfeint.init??

@mauricio

looking into it.... will get back to you as soon as we know something - top things off - OpenFeint changed their forum and lots of their forums didn't cross over.

c.

I have included the plist file, I have enable Game Center in itunes connect and im pretty sure everything is the way it should be, but I still get the error "this game is not recognized by gamecenter".

I am not quite sure why I am getting this error or what needs to be done in order for this to work correctly. Any one have any ideas?

Maybe there are some settings in iTunes connect I do not know about?

Thanks in advance!

I'm also getting the "this game is not recognized by game center" message despite including a plist file and setting up Game Center in iTunes connect.

Is there a way to just disable the game center prompt altogether? Even without the plist file included, I still get prompted to sign into Game Center. I'd rather just cut it out entirely at this point and go with OpenFeint.

Nick

Hey everyone,

I solved some of my problems and wanted to post in case you were having the same problem. If you enable Game Center, your development binaries have to have the same name as the bundleID in iTunes Connect (I should have known this) to be recognized as compatible.

ALSO, deleting the development binary on your device before uploading a new version seemed to make a difference, FWIW.

Nick

I'm also having the problem of Game Center saying it is not recognized.

OpenFeint does do its job, if I'm logged out of GC I'll get to message to log in. Once I do that, i get: not recognized. Everything should be set up correctly. Both in the .plist and iTunes Connect.

However, I'm still using a trial version, so I'm building using development profiles. Could this be the problem? I've noticed my builds have bundle id: com.companyname.app, instead if: seedid.com.companyname.app

I'm hoping thats it, because its starting to get a but frustrating :)

People looking at this info should probably also see the thread about a tricky Game Center issue I ran into:

http://developer.anscamobile.com/forum/2011/05/17/apples-requirements-game-center

Can anyone please clarify what this mean and provide a step-by-step instruction?

"If you enable Game Center, your development binaries have to have the same name as the bundleID in iTunes Connect (I should have known this) to be recognized as compatible."

I went to create an Ad Hoc provisioning but when I tried to use the bundle ID in the profile name, it says I can only use alpha and numbers so I guess that's not the right place.

Thanks.

views:52519 update:2011/9/17 18:17:57
corona forums © 2003-2011