For the complete documentation index, see llms.txt. This page is also available as Markdown.

Game.openLeaderboard

Functional API openGameCenterLeaderboardYou can use the same feature with it as well.

Feature description

Open the Game Center leaderboard web view in the game app. Toss app Android/iOS 5.221.0 It can be used on the above.

Type

Game.openLeaderboard(): Promise<void>;

Params

None

Response

There is no return value.

Error

If called from a mini app rather than a game app, the Promise is rejected. In this case error.messageis "The leaderboard API can only be used in game apps.".

Example code

import { Game } from "@apps-in-toss/web-framework";

const button = document.querySelector("#open-leaderboard");

button.addEventListener("click", async () => {
  try {
    await Game.openLeaderboard();
  } catch (error) {
    console.error(error);
  }
});

Was this helpful?