Hello,
I am having a heck of a time trying to get an achievement working in my app. I followed as close to the tutorial as possible but I’m not having any luck. Here is some of my code…
gameNetwork.request( "loadAchievements", { listener=requestCallback } )
local achievements = {}
achievements.FirstApple = "com.appletest.FirstApple"
local UserScore = 0
local function onIncrementScore( event )
setUserScore( userScore+1 )
-- unlock achievements when specific tap requirement is met
if loggedIntoGC then
local message
if userScore == 1 then
print("working")
gameNetwork.request( "unlockAchievement", {
achievement = {
identifier=achievements["FirstApple"],
percentComplete=100,
showsCompletionBanner=true,
}
}); message = "You completed the \"Just One Tap\" achievement!"
end
end
end
so the button isn’t working but when replaced the old OpenFeint code with this, it still wouldn’t work. I put in a print command to see if it was working but nothing. noMoreApples is called at the end of the level…
local achievements = {}
achievements.FirstApple = "FirstApple" --The line here and above are called higher up in my code
noMoreApples = function()
local function achievement( event )
print("work")
if loggedIntoGC then
local message
if userScore == 1 then
print("work")
gameNetwork.request( "unlockAchievement", {
achievement = {
identifier=achievements["FirstApple"],
percentComplete=100,
showsCompletionBanner=true,
}
}); message = "You completed the \"Just One Tap\" achievement!"
end
end
end
If you could help, that would be great!
Thanks,
Danny [import]uid: 59140 topic_id: 34869 reply_id: 334869[/import]