At any time, you can retrieve values for specific parameters that you might use in your game, such as the user's browser language.
Identify the platform on which the game is currently running to customize features and settings accordingly.
Copy PlaygamaBridge::PlatformId()
Returns the ID of the platform on which the game is currently running. Possible values are: playgama
, vk
, ok
, yandex
, facebook
, crazy_games
, game_distribution
, wortal
, playdeck
, telegram
, y8
, lagged
, msn
, poki
, qa_tool
, mock
.
Check the language to display proper text labels.
Get the language set by the user on the platform or the browser language if not provided by the platform, to localize game content.
Copy PlaygamaBridge::PlatformLanguage()
If the platform provides user language data, this will be the language set by the user on the platform. If not, it will be the browser language.
Format: ISO 639-1. Example: en
, ru
URL Parameter
Embed auxiliary information into the game URL to pass additional data or settings when launching the game.
Copy PlaygamaBridge::PlatformPayload()
This parameter allows embedding auxiliary information into the game URL:
yandex.com/games/app/game_id?payload=your-info
crazygames.com/game/game_name?payload=your-info
site.com/game_name?payload=your-info
Domain Information
Retrieve the top-level domain of the platform to handle domain-specific configurations and behavior.
Copy PlaygamaBridge::PlatformTld()
Returns the top-level domain (TLD) of the platform. If there is no data – null
. If the data is available – com
, ru
, etc.
Is Get All Games Supported
Is Get Game By Id Supported
Get All Games
This method retrieves the correct links to the developer's other games.
Copy This Example
Copy {"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::PlatformGetAllGames"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnGetAllGamesCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareNumbers"},"parameters":["PlaygamaBridge::PlatformAllGamesCount()",">","0"]}],"actions":[{"type":{"value":"SetNumberVariable"},"parameters":["CurrentIndex","=","0"]}],"events":[{"type":"BuiltinCommonInstructions::Repeat","repeatExpression":"PlaygamaBridge::PlatformAllGamePropertiesCount()","conditions":[],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"yandex\""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"AppID:\" + PlaygamaBridge::PlatformAllGamesPropertyValue(CurrentIndex, \"appID\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Title:\" + PlaygamaBridge::PlatformAllGamesPropertyValue(CurrentIndex, \"title\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"URL:\" + PlaygamaBridge::PlatformAllGamesPropertyValue(CurrentIndex, \"url\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"cover URL:\" + PlaygamaBridge::PlatformAllGamesPropertyValue(CurrentIndex, \"coverURL\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"icon URL:\" + PlaygamaBridge::PlatformAllGamesPropertyValue(CurrentIndex, \"iconURL\")","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"SetNumberVariable"},"parameters":["CurrentIndex","+","1"]}]}]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
Get Game By Id
This method retrieves the correct link to a specific game from the developer.
Copy This Example
Copy {"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"gameId\"","\"111111\"",""]},{"type":{"value":"PlaygamaBridge::PlatformGetGameById"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnGetGameByIdCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"yandex\""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"App ID:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"appID\"))","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Title:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"title\"))","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"URL:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"url\"))","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Icon URL:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"iconURL\"))","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Cover URL:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"coverURL\"))","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Is Available:\" + ToString(PlaygamaBridge::PlatformGameByIdPropertyValue(\"isAvailable\"))","\"info\"",""]}]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
The usage of Send Message action with the parameter GAME_READY is mandatory!
Don't forget to implement it.
Send predefined messages to the platform to trigger specific actions or events, such as signaling that the game is ready.
The game has loaded, all loading screens are passed, the player can interact with the game.
Any loading inside the game has started. For example, when a level is loading.
In-game loading has finished.
Gameplay has started. For example, the player entered a level from the main menu.
Gameplay has ended/paused. For example, when exiting a level to the main menu, opening the pause menu, etc.
The player reached a significant moment. For example, defeating a boss, setting a record, etc.
Server Time
Copy This Example
Copy {"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::GetServerTime"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnGetServerTimeCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::HasServerTime"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["ToString(PlaygamaBridge::ServerTime())","\"info\"",""]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
Current Visibility State
Check if the game tab is visible or hidden, and adjust game behavior accordingly, such as muting sound when hidden.
Copy PlaygamaBridge::VisibilityState()
Returns the current visibility state of the game (the tab with the game). Possible values: visible
, hidden
.
Copy This Example
Copy {"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnVisibilityStateChanged"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::VisibilityState()","=","\"visible\""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Visible\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::VisibilityState()","=","\"hidden\""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Hidden\"","\"info\"",""]}]}]}],"eventsCount":1,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}