Problems with Openfeint sample

I’m trying to build the Openfeint landscape sample and I’m having some trouble. I registered with OP, got my 2 product keys which I copied to the sample and then I built for my iphone. But when I run it I get the text that I should register and get the keys.

Is there something else that needs to be done in OP besides registering the app for the codes to become valid? I’m close to being at the point I need to add OP to my game and it’s very dissapointing I can’t get it working. Anyone else have the same issue? I’ve looked through the docs, but I can’t find anything that would explain why the codes aren’t working.

[import]uid: 10835 topic_id: 3642 reply_id: 303642[/import]

Make sure you’re using the Leaderboard ID rather than the OpenFeint Client Application ID. They’re different numbers. [import]uid: 1560 topic_id: 3642 reply_id: 11107[/import]

I’m not even getting that far. The sample just fails to initialize saying I haven’t input the codes. Just the same as if they were nil.

I’m putting the product key and the product secret, there’s no mention of using the Client Application ID, so I didn’t put that anywhere. I created a leaderboard and I’m using the leaderboardID for that, but like I said I’m not getting past the init phase.

Has anyone tested that the sample works? I can’t see what I’m doing wrong. [import]uid: 10835 topic_id: 3642 reply_id: 11131[/import]

I have it working in my app, Blocfall. Will post details when I have time. [import]uid: 1560 topic_id: 3642 reply_id: 11132[/import]

Thanks, I really appreciate it. [import]uid: 10835 topic_id: 3642 reply_id: 11133[/import]

I’m using a slightly modified version of the safeopenfeint.lua module:

[lua]–[[

Name: safeopenfeint.lua
Author: Stuart Carnie, Manomio
Description: Safely wraps the openfeint module, which currently does not work on Corona Sim, Android and iPhone Simulator, preventing crashes or hanging apps
Change log:
20100815 - Initial release

–]]

module(…, package.seeall)

local isiPhoneSim = system.getInfo(“name”) == “iPhone Simulator”
local isiOS = system.getInfo(“platformName”) == “iPhone OS”
local isCorona = system.getInfo(“environment”) == “simulator”

local isOFSupported = not isiPhoneSim and isiOS and not isCorona

if isOFSupported then
local openfeint = require “openfeint”
end

function isSupported()
return isOFSupported
end

function init(productKey, productSecret, displayName)
if not isOFSupported then return end

openfeint.init(productKey, productSecret, displayName)
end

function launchDashboard()
if not isOFSupported then return end

openfeint.launchDashboard(“leaderboards”)
end

function launchDashboardWithAchievements()
if not isOFSupported then return end

openfeint.launchDashboard(“achievements”)
end

function setHighScore( lbID, points )
if not isOFSupported then return end

local id = lbID
local scr = points
openfeint.setHighScore( { leaderboardID=id, score=scr } )
end

function unlockAchievement( achievementId )
if not isOFSupported then return end
local aID = achievementId
openfeint.unlockAchievement( aID )
end[/lua]

And the following calls in button functions or score checks for achievements:

[lua] safeopenfeint.launchDashboard()
–and
safeopenfeint.launchDashboardWithAchievements()
–and
safeopenfeint.setHighScore( lbID, points )
– and
safeopenfeint.unlockAchievement( “xxxxxx” )
— and early in the main file
safeopenfeint.init(“secretxxx”, “secretyyy”, “appName”)
local lbID = “xxxxxx”[/lua] [import]uid: 1560 topic_id: 3642 reply_id: 11184[/import]

Thank you, that did it. I wasn’t putting the product code and product secret in brackets, since it wasn’t all that clear in the sample. Now it’s working fine, thanks. [import]uid: 10835 topic_id: 3642 reply_id: 11224[/import]