Help - Open Feint & Game Center

I’d like to integrate Open Feint and Game Center leaderboards, and I’m wondering if there are good resources I could tap into.

What I want to do is to display two bottons. One that says Open Feint and another that says Game Center, which enable access to these networks.

So far, I’ve followed Peach’s tutorial, part 1, on Techority for adding OpenFeint to get my feet wet and to understand the basics, and I have also looked at the game network API.

I’ve also stumbled on to this thread: http://developer.anscamobile.com/forum/2011/10/19/implement-game-center#comment-62182

Do I need my game app already in App Store before I can fully integrate and test Open Feint and Game Center? The answer is probably no… but I could be mistaken. Also, if it’s okay with game-still-in-development, I’m not so sure how much of the app needs to be completed for the Open Feint integration.

I created a developer account with Open Feint. What else do I need to set up so that I can get this done?

I’m so new to this, and I’d sooo appreciate any tips and pointers you might be able to give. Also, if anyone knows of any places (i.e., URLs) that provide thorough explanation on how to implement both Open Feint and Game Center, using Corona SDK, like a step-by-step instruction, I’d so like to know about it.

I’ll continue to look around, but oh, please, have mercy and help me out. (I feel like adding “I WILL LOVE YOU FOREVER” on the subject line. That one is so catchy, and it always made me want to click to see what’s up with the thread.)

Naomi
[import]uid: 67217 topic_id: 18674 reply_id: 318674[/import]

Hi Naomi,

I refer to this article for my openfeint.

http://ipad.about.com/od/iPad-App-Dev/a/How-To-Add-OpenFeint-Using-Corona-SDK.htm

It works for me.

As for gamecenter i am not implementing it at the moment.

Good Luck!
Cheers! [import]uid: 74883 topic_id: 18674 reply_id: 71742[/import]

Thank you so much, Burhan! I’ll take a look at the article for sure. Thanks again.

Naomi [import]uid: 67217 topic_id: 18674 reply_id: 71748[/import]

The guides you’ve been given should cover everything I think. I would point out that you can make a Game Center button using system.openURL(“GameCenter:”) [import]uid: 36054 topic_id: 18674 reply_id: 71751[/import]

Thank you so much, @blasterv! Let’s see if I can get this sorted out.

Thanks again!

Naomi [import]uid: 67217 topic_id: 18674 reply_id: 71758[/import]

local function gotoGameCenter()  
 local DEVICE = system.getInfo ( "environment" )  
 local AppURL = "gamecenter:"  
 if DEVICE == "simulator" then  
 print ( "Cannot spawn this URL in the simulator" )  
 else  
 if testNetworkConnection() then  
 system.openURL ( AppURL )  
 end  
 end  
end  

When I was trying to get get OF and GC to talk to each other, I used this code attached to a button to get to gameCenter.

This worked for me and addressed Apple’s needs to have access to game center.

Now I never could get OF to talk to GC and post leaderboards, so I ended up killing the GC support and there is NO help if there is a problem between the two.

[import]uid: 19626 topic_id: 18674 reply_id: 71767[/import]

Hopefully you wont need to implement OF to have GC much longer :wink:

Until then I will say I built an app using both last month (using achievements and leaderboards) which worked fine.

Peach :slight_smile: [import]uid: 52491 topic_id: 18674 reply_id: 71780[/import]

Thank you so much, Rob! I’ll give it a shot when I get to it.

Hey, Peach, great to hear you say Hopefully you wont need to implement OF to have GC much longer :wink:

Could it be that there is a plan for updating the gameNetwork API to include functions/parameters for Game Center? And if so, when might it be coming? Would it be included with the soon-to-be-released stable build? (If so, is it already available in the latest daily build??) Or would it come after the much anticipated new stable build, like, say, in January?

Naomi
[import]uid: 67217 topic_id: 18674 reply_id: 71805[/import]

All I can say is that it’s not going to suddenly be available tomorrow but it is a very high priority and it is worth staying tuned. (If you don’t already follow @carlosicaza on Twitter you should; he tends to tweet about things like this from time to time.)

Peach :slight_smile: [import]uid: 52491 topic_id: 18674 reply_id: 71817[/import]

Thank you, Peach!

Naomi [import]uid: 67217 topic_id: 18674 reply_id: 71824[/import]

Great cuz GC implementation trough OF doesn’t work as it should… My last game still use old and rock-solid Director 1.3 and even with trick like:

UIApplicationExitsOnSuspend = false AND/OR

[lua]local onSystem = function( event )
if event.type == “applicationSuspend” then
physics.pause()
elseif event.type == “applicationResume” then
physics.start()
elseif event.type == “applicationExit” then
if system.getInfo( “environment” ) == “device” and system.getInfo( “platformName” ) == “iPhone OS” then
os.exit()
end
end
end

Runtime:addEventListener( “system”, onSystem )[/lua]

Game Center restart my game quite often :confused: [import]uid: 12704 topic_id: 18674 reply_id: 71849[/import]

I thought things are going super smoothly with the wonderful pointers I received under this thread. But then, I hit a snag. I can’t see my Leaderboard on my device. Please note, I saw it after I implemented one Leaderboard, and I thought “cool, now I know how this thing works, let me add bunch more”.

But then… the newly added Leaderboards refuse to appear on device even though, on the OpenFeint website, I see that new high scores are posted to the newly added Leaderboards. Then I remembered reading something about a similar issue brought up by number of other developers here on forum. One of the solutions sounded like things will clear up by re-doing the Leaderboards.

So, I went ahead and deleted all highscores, deleted all Leaderboards, and before I added a new set of Leaderboards, I generated a device build and checked to see if the old Leaderboard shows up on my device (and confirmed it’s gone). And then I created whole bunch of Leaderboards that I want for my game, and then…

After using the new unique IDs assigned to the new set of Leaderboards, I updated my code, generated a device build, played a level, and I got the OpenFeint notification when I got the new high score. All felt good, but… when I look up the Leaderboards from within my game, all it says is “There are no leaderboards for MyGame.” On OpenFeint website, I see the high scores registered under two Leaderboards as they should.

What do I do now? Would the Leaderboards eventually show up on the device if I waited long enough?

I’d so appreciate any and all feedback.

Naomi

P.S. I decided not to worry about integrating Game Center for now with a hope that we will be able to add Game Center without Open Feint soon… hopefully before I’m ready to ship my game. [import]uid: 67217 topic_id: 18674 reply_id: 72075[/import]

I’ve messed around with OF a lot. And also same errors as yours. I find Corona very, very easy.Even tought about paying for tutorials to get me coding ASAP, but luckly for me, I didn’t do that.

Corona is excellent for certian type of games, arcade, adventure, etc. But it lacks certian stuff that are essential these days, like API’s for GC, and especially multiplayer gaming.

But for now, I will stick around and play with corona. Hopefully all of this will be implemented in Corona in near future. And as you, I also given up implementing some stuff in my game, at least until Corona supports what I need :slight_smile: [import]uid: 107783 topic_id: 18674 reply_id: 72112[/import]

Thank you, @mileni171, for sharing your experience.

I created a couple of OF test users, and recorded some more high scores, but I still don’t see the Leaderboards from within any of the test device. I’ve submitted support request directly to Open Feint, explaining this case. I don’t know where it fails, really. Hopefully I will hear back from them. Also, maybe, someone here on forum has already figured out the solution for this and will be able to share it with us. And… if not, maybe somehow this issue would go away…

It’s a bit frustrating not to be able to fully test the OpenFeint integration. Adding/deleting items like leaderboard(s) to cause this type of oddity makes it unwieldy for development.

Naomi [import]uid: 67217 topic_id: 18674 reply_id: 72118[/import]

OpenFeint - yes - people have reported issues with boards not showing before. It’s an OF issues not a Corona issue.

Often they randomly appear after a period of time. One person reported they appeared once the app was published and approved by OF.

Opening a support ticket with them is, I think, the best course of action when it comes up.

Peach :slight_smile: [import]uid: 52491 topic_id: 18674 reply_id: 72135[/import]

Peach brings up a good point. Have you submitted your game to OF for approval? That had me thrown for a while. [import]uid: 19626 topic_id: 18674 reply_id: 72169[/import]

Hi Naomi, I don’t have plug-n-play code but I do have separate OF and Game Center buttons in my apps, created with help from Corona’s documentation and forum posts. The leaderboards were set up first in OF and Game Center. (OF also uses a .plist file.)

The Game Center button takes them out of the app but alerts/asks them first if they want to exit.

I was able to test these before submitting my app using test user IDs in OF and Game Center.

I’m still a newbie so keep that in mind!
[lua] – OPEN FEINT

local gameNetwork = require “gameNetwork”

sceneGroup = display.newGroup()

local gameNetwork = require “gameNetwork”

local prop = require (“property”)
local propertyBag
propertyBag = prop:init()

btnBottomStartX = 0
btnBottomStartY = sceneCenterY+132
local btnBottomScale = .5

local btnOF = display.newImageRect(“images/btnOpenFeint.png”, 232, 61)
btnOF.x = sceneCenterX-20; btnOF.y = sceneCenterY+130
btnOF.xScale = btnBottomScale
btnOF.yScale = btnBottomScale
sceneGroup:insert(btnOF)

local function goOF( event )

local t = event.target
local phase = event.phase

if “began” == phase then

t.alpha = .5

display.getCurrentStage():setFocus( t )
t.isFocus = true

elseif “moved” == phase then

elseif event.phase == “ended” then

t.alpha = 1

display.getCurrentStage():setFocus( nil )
t.isFocus = false

gameNetwork.show( “leaderboards” )
–gameNetwork.show()

end
end
btnOF:addEventListener(“touch”, goOF)

local btnGC = display.newImageRect(“images/btnGC.png”, 90, 92)
btnGC.x = btnOF.x+100; btnGC.y = btnOF.y
btnGC.xScale = .45
btnGC.yScale = .45
sceneGroup:insert(btnGC)

local function goGC( event )

local t = event.target
local phase = event.phase

if “began” == phase then

t.alpha = .5

display.getCurrentStage():setFocus( t )
t.isFocus = true

elseif “moved” == phase then

elseif event.phase == “ended” then

t.alpha = 1

display.getCurrentStage():setFocus( nil )
t.isFocus = false

– Opens the gamecenter app.
local function testNetworkConnection()
local netConn = require(‘socket’).connect(‘www.apple.com’, 80)
if netConn == nil then
return false
end
netConn:close()
return true
end

local function gotoGameCenter()
local device = system.getInfo ( “environment” )
local appURL = “gamecenter:leaderboards”
if device == “simulator” then
print ( “Cannot spawn this URL in the simulator” )
else
if testNetworkConnection() then
system.openURL ( appURL )
end
end
end

local function onComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then – USER CLICKED YES TO EXIT
gotoGameCenter()
elseif 2 == i then
return nil
end
end
end

local function makeAlert(event)
local alert = native.showAlert( “Do you want to exit the game to Game Center?”, " ", { “Yes, go to Game Center”, “No, don’t exit to Game Center” }, onComplete )
end
makeAlert()

end
end
btnGC:addEventListener(“touch”, goGC)[/lua] [import]uid: 40033 topic_id: 18674 reply_id: 72188[/import]

So gamecenter support is very near peach? [import]uid: 55808 topic_id: 18674 reply_id: 72211[/import]

Naomi, you submit your app from the OF developer portal, then probably the next day they approve it. But you have to submit it first. It should be the top center of this page, while you’re working on your app:

https://api.openfeint.com/dd/games

I don’t think its too obvious… even though its dead in the middle of the screen.
[import]uid: 19626 topic_id: 18674 reply_id: 72217[/import]

Hey, Rob, thank you for letting me know. You know what, when I sign in to OpenFeint developer account, and when I’m in Currently Working on area where I see my game showing on the left side, I also see iOS App: In Development in the middle/center area with an orange button that says Enable iOS App.

When I click on Enable iOS App , it requires me to fill out iOS Settings under Application Information. I kept it blank because I don’t have all items required for this section ready yet. Maybe that’s the problem. I’ll create something real quick (with temp graphics) and see if it changes anything.

Thanks again!

Naomi [import]uid: 67217 topic_id: 18674 reply_id: 72226[/import]