Platform Parameters
Last updated
Last updated
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.
Returns the platform ID on which the game is currently running. Possible values: playgama
, vk
, ok
, yandex
, facebook
, crazy_games
, game_distribution
, wortal
, playdeck
, telegram
, vk_play
, y8
, lagged
, msn
, mock
.
Get the language set by the user on the platform or the browser language if not provided by the platform, to localize game content.
Returns the language set by the user on the platform. If the platform does not provide this data, it returns the browser language. Format: ISO 639-1. Example: jp
, en
.
Embed auxiliary information into the game URL to pass additional data or settings when launching the game.
Allows embedding auxiliary information into the game URL.
Platform | URL Format |
---|---|
Retrieve the top-level domain of the platform to handle domain-specific configurations and behavior.
Returns the top-level domain (TLD) of the platform. If there is no data – null
. If the data is available – com
, ru
, etc.
Send predefined messages to the platform to trigger specific actions or events, such as signaling that the game is ready.
To use constants for convenience:
The call to send_message with the parameter game_ready is mandatory!
Don't forget to implement it.
Check if the game tab is visible or hidden, and adjust game behavior accordingly, such as muting sound when hidden.
Returns the current visibility state of the game (the tab with the game). Possible values: visible
, hidden
.
React to changes in visibility state. For example, mute the game sound when the state is hidden
and unmute when the state is visible
.
Message | Description |
---|---|
VK
http://vk.com/game_id#your-info
Yandex
http://yandex.com/games/app/game_id?payload=your-info
Crazy Games
crazygames.com/game/game_name?payload=your-info
Mock
site.com/game_name?payload=your-info
game_ready
The game has loaded, all loading screens have passed, and the player can interact with the game.
in_game_loading_started
Some loading inside the game has started. For example, when a level is loading.
in_game_loading_stopped
Loading inside the game is finished.
gameplay_started
Gameplay has started. For example, the player has entered a level from the main menu.
gameplay_stopped
Gameplay has ended/paused. For example, when exiting from a level to the main menu or opening the pause menu.
player_got_achievement
The player has reached a significant milestone. For example, defeating a boss or setting a new record.