gamecircle.Achievement.GetAchievements

Type Function
Library gamecircle.*
Return value None
Revision Release 2022.3683
Keywords achievement, get

Overview

This function works like a mass-grab version of [GetAchievement][plugin.gamecircleAchievement.GetAchievement]. It fetches all the achievements setup on Amazon's servers for the app.

Syntax

gamecircle.Achievement.GetAchievements( callback )
callback (required)

Function. The callback function for when the achievement's information has been fetched. The callback will recieve a single parameter of type [AchievementsReturn][plugin.gamecircleAchievement.AchievementsReturn]

Examples

local achievementID = "myFirstAchievement"  
local gamecircle = require("plugin.gamecircle")  
gamecircle.Init(true, false, false)  
function AchievementCallback(returnValue)  
    if returnValue.isError == true then  
        print("Get Achievement request returned with error message: " .. returnValue.errorMessage)  
    else  
        print("Achievement information recieved!")  
        for i, achievement in ipairs(returnValue) do  
            print("-Achievement # " .. i)  
            print("--id: " .. achievement.id)  
            print("--title: " .. achievement.title)  
            print("--desc: " .. achievement.desc)  
            print("--isUnlocked: " .. achievement.isUnlocked)  
            print("--unlockedDate: " .. achievement.unlockDate)  
            print("--imageURL: " .. achievement.imageURL)  
            print("--isHidden: " .. achievement.isHidden)  
            print("--pointValue: " .. achievement.pointValue)  
            print("--position: " .. achievement.position)  
            print("--progress: " .. achievement.progress)  
        end  
    end  
end  
gamecircle.Achievement.GetAchievements(achievementID, AchievementCallback)