Please Select Your Location

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

Unity

using UnityEngine;
using System;
using Viveport;

/** Language: C# */
public class ViveportDemo : MonoBehaviour
{
   static string VIVEPORT_ID = "bd67b286-aafc-449d-8896-bb7e9b351876";

   // Use this for initialization
   void Start ()
   {
       Api.Init(InitStatusHandler, VIVEPORT_ID);
   }

   private static void InitStatusHandler(int nResult)
   {
       Viveport.Core.Logger.Log("Init(): " + nResult);
       if (nResult != 0)
       {
          Viveport.Core.Logger.Log("Init setup error, please close the content...");
          // Handle error
          return;
       }
       Token.IsReady(IsTokenReadyHandler);
   }

   private static void IsTokenReadyHandler(int nResult)
   {
       if (nResult != 0)
       {
          Viveport.Core.Logger.Log("Platform setup error, please close the content ...");
          // Handle error
          return;
       }
       Token.GetSessionToken(GetSessionTokenHandler);
   }

   private static void GetSessionTokenHandler(int nResult, string message)
   {
       if (nResult != 0)
       {
          Viveport.Core.Logger.Log("GetSessionTokenHandler error: " + nResult + ", message:" + message);
          // Handle error
          return;
       }
       Viveport.Core.Logger.Log("GetSessionTokenHandler is successful, token:" + message);
       // Do more things
   }
}