Links to other games
SDK Yandex Games provides the ability to automatically obtain correct links to your other games (both specific ones and the entire list) to reference them in the game.
To ensure that the game is available on the current platform and domain (requirement 8.4.1), use the methods GamesAPI.getAllGames()
and GamesAPI.getGameByID()
.
ysdk.features.GamesAPI.getAllGames()
Use the method ysdk.features.GamesAPI.getAllGames()
when you need to retrieve information about all your games that are available on the current platform and domain.
Example
ysdk.features.GamesAPI.getAllGames().then(({games, developerURL}) => {
games.forEach((game) => {
// Game processing logic.
})
}).catch(err => {
// Error in retrieving game data.
})
Response Format
{
games: IGame[];
developerURL: string;
}
Parameter |
Type |
Description |
|
Array of objects with game information. |
|
|
string |
Link to the developer's page. |
ysdk.features.GamesAPI.getGameByID()
Use the method ysdk.features.GamesAPI.getGameByID(appID)
when you need to retrieve data about a specific game and its availability on the current platform and domain.
appID
— Game ID from the developer console.
Example
ysdk.features.GamesAPI.getGameByID(100000).then(({isAvailable, game}) => {
if (isAvailable) {
// If the game is available, handle the game.
} else {
// Logic if the game is unavailable, the game object is undefined.
}
}).catch(err => {
// Error retrieving game data.
})
Response Format
{
game?: IGame;
isAvailable: boolean;
}
Parameter |
Type |
Description |
|
An object containing information about the game. |
|
|
boolean |
Indicates if the game is available:
|
IGame Interface
interface IGame {
appID: string;
title: string;
url: string;
coverURL: string;
iconURL: string;
}
Parameter |
Type |
Description |
|
string |
The game's identifier, as set in the developer console. |
|
string |
The name of the game. |
|
string |
The link to the game. |
|
string |
The link to the game's cover image. |
|
string |
The link to the game's icon. |
Note
Our support team can help publish finished games on Yandex Games. If you have any questions about development or testing, ask them in the Discord channel.
If you are facing an issue or have a question regarding the use of Yandex Games SDK, please contact support:
Array of objects with game information.
Link to the developer's page.
An object containing information about the game.
Indicates if the game is available:
true
— the game is available;false
— the game is not available, thegame
object is undefined (undefined
).
The game's identifier, as set in the developer console.
The name of the game.
The link to the game.
The link to the game's cover image.
The link to the game's icon.