Use achievements to mark in-game milestones, such as defeating the first boss or collecting 100 coins. Optional. Check isSupported, then call unlock(...) when the criteria are met.
Unlike Leaderboards and Payments, achievement IDs are configured in each platform's developer dashboard, not in playgama-bridge-config.json. Keep a constants file that maps your in-game milestones to platform achievement IDs.
Support
Check this before enabling achievement logic or showing achievement UI.
bridge.achievements.isSupported
Bridge.achievements.isSupported
Check this before calling getList(...). Some platforms can unlock achievements but cannot return the full list.
bridge.achievements.isGetListSupported
Bridge.achievements.isGetListSupported
Check this before showing a native achievement overlay.
playgama_bridge_achievements_get_list()
// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_achievements_get_list_callback" {
if async_load[? "success"] {
var achievements_list = json_parse(async_load[? "data"])
}
}
local bridge = require("bridge.bridge")
function init(self)
local options = { }
bridge.achievements.get_list(options, function (_, data)
-- success
end, function ()
-- error
end)
end
func _on_show_native_popup_button_pressed():
var options
Bridge.achievements.show_native_popup(options, funcref(self, "_on_show_native_popup_completed"))
func _on_show_native_popup_completed(success):
print(success)
func _on_show_native_popup_button_pressed():
var options
Bridge.achievements.show_native_popup(options, Callable(self, "_on_show_native_popup_completed"))
func _on_show_native_popup_completed(success):
print(success)
playgama_bridge_achievements_show_native_popup()
// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_achievements_show_native_popup_callback" {
if async_load[? "success"] {
// your logic here
}
}
local bridge = require("bridge.bridge")
function init(self)
local options = { }
bridge.achievements.show_native_popup(options, function ()
-- success
end, function ()
-- error
end)
end