Example usage
Make sure you have a VIVEPORT ID and VIVEPORT Key from the VIVEPORT Developer Console .
Make sure you have a Photon secret. See Photon Secret .
-
Initialize the Top Level API by calling
Viveport.Api.Init
. For Unity developers, this is typically called as MonobehaviorStart()
. -
If you’re using the DRM API, call
Viveport.Api.Getlicense
to verify if the current end user account is allowed to launch the content. -
Check that there is a connection to VIVEPORT and initialize the Session Token API by calling
Viveport.Token.IsReady()
. -
Get a session token by calling
Viveport.Token.GetSessionToken
. The token is retrieved by the message ofcallback
. -
Use the token in your code. Make sure your code uses
CustomAuthenticationType.Viveport
, and make sure to set the AuthParameter to"userToken"
as the VIVEPORT token. For details, see Photon VIVEPORT Authentication on the Photon Website. -
Call
Viveport.Api.Shutdown
to release VIVEPORT SDK resources when no longer needed. In Unity, this is typically either in MonoBehaviorOnDestroy()
or beforeApplication.Quit()
.