Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Example usage

The following example highlights how a developer might use the VIVEPORT Leaderboards API in their title.

Make sure you have a VIVEPORT ID and Key for your title before trying to implement any of the API functions.

  1. Call the Top Level API using Viveport.Api.Init to initialize the VIVEPORT SDK. For Unity developers, this is typically called as Monobehavior Start() .
  2. Call Viveport.UserStats.IsReady() to initialize the VIVEPORT Leaderboards API.
  3. Call Viveport.Leaderboard.DownloadLeaderBoardScores() to download scores.
  4. Do any of the following:
    • Call Viveport.Leadboard.GetCount() to check the number of leaderboard scores, which can be used to determine index values for GetLeaderboardScore() .
    • Call GetLeaderboardSortMethod() to get the sorting method used for the leaderboard score order. This can be used to organize the information for local display.
    • Call GetLeaderboardDisplayType() to determine what kind of data the leaderboard stores. See LeaderBoardDisplayType() for a complete list.
  5. Call GetLeaderboardScore() using the correct index to retrieve scores.
  6. Show leaderboards to the end user.
  7. If there are new score to upload, call UpLoadLeaderboardScore() to upload them to the VIVEPORT backend.
    Keep in mind that changes will be handled based on the leaderboard configuration in the VIVEPORT Developer Console , such as whether the scores are aggregated or replaced.
  8. Call Viveport.Api.Shutdown to release VIVEPORT SDK resources when no longer needed. In Unity, this is typically either in MonoBehavior OnDestroy() or before Application.Quit() .