API-Namen, Parameter und Code stehen in ihrer englischen Originalform.

iOS

ios

Methoden

initPurchases()
canPurchase()
initPurchase(id)
restorePurchases(strings)
setAchievementProgress(id, percent)
unlockAchievement(id)
getAchievement(id)
showAchievements()
signIn()

initPurchases()

function ios_callback(str, a1, a2, a3, a4)
  if str == "PRODUCT_DESCRIPTION" then
    print(string.format("product id:%s title:%s descr:%s price:%s",a1,a2,a3,a4))
  elseif str == "FAILURE" then
    print("fail info:"..a1)
  elseif str == "SUCCESS" then
    print(string.format("purchased id:%s count:%s",a1,a2))
  elseif str == "LOGGED_IN" then
    print("logged in")
  elseif str == "LOGIN_FAILURE" then
    print("login failed")
  end
end

ios.initPurchases({"ID"})

if ios.canPurchase() then
    ios.initPurchase("ID") -- begin purchase
end

if ios.signIn() then
    ios.unlockAchievement("ID")
    ios.setAchievementProgress("ID",100)
end

canPurchase()

Return Type Description
bool

initPurchase(id)

Parameter Type Description
id string

restorePurchases(strings)

Parameter Type Description
strings table with ids

setAchievementProgress(id, percent)

Parameter Type Description
id string
percent int

unlockAchievement(id)

Parameter Type Description
id string

getAchievement(id)

Parameter Type Description
id string
Return Type Description
int id

showAchievements()

signIn()

Return Type Description
bool

JS

JS

Methoden

js(js)

js(js)

js([[jsfunction();]])

execute javascript statement

Parameter Type Description
js string

⌛PS4

ps4

Methoden

initAchievements()
unlockAchievement(id)
getAchievement(id)
user(id)
saveState()
resetSaveData()

initAchievements()

load trophies

unlockAchievement(id)

unlock trophy

Parameter Type Description
id int

getAchievement(id)

Parameter Type Description
id int
Return Type Description
bool unlocked

user(id)

Parameter Type Description
id int
Return Type Description
table { id = userID, name = name

saveState()

Initing
Okay
Broken
Error
OutOfSpace

Return Type Description
string state

resetSaveData()

✖ steam

⌛Xbox1

xbox1

Methoden

updateAchievement(id, percent)
setPresence(name, ...)
user(id)
saveUser()
saveState()
showAccountPicker(AccountPickerOptions)
loadEventManifest(file)
writeEvent(name, ...)

updateAchievement(id, percent)

Parameter Type Description
id string
percent int

setPresence(name, ...)

Parameter Type Description
name string
... string

user(id)

Parameter Type Description
id int
Return Type Description
table { id = userID, xboxUserId = xboxUserId, name = name

saveUser()

Return Type Description
table { id = userID, name = name

saveState()

Initing
Okay
CantSave
NotLoggedIn

Return Type Description
string state

showAccountPicker(AccountPickerOptions)

Parameter Type Description
AccountPickerOptions int

loadEventManifest(file)

Parameter Type Description
file string

writeEvent(name, ...)

Parameter Type Description
name string
... variant