Example usage
The following example highlights how a developer might use the VIVEPORT Deeplink 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.
-
Call the Top Level API using
Viveport.Api.Initto initialize the VIVEPORT SDK. For Unity developers, this is typically called as MonobehaviorStart(). -
If you’re using the DRM API, call
Viveport.Api.Getlicenseto verify that the current end-user account is allowed to launch the title. -
Call
Viveport.Deeplink.IsReady()to initialize the Deeplink API. -
Do any of the following:
-
Launch your title directly by calling
Viveport.Deeplink.GoToAppwith the VIVEPORT ID of your title. -
Go to the VIVEPORT page for your title by calling
Viveport.Deeplink.GoToStore. -
Go to the VIVEPORT store main page by calling
Viveport.Deeplink.GoToStorewithout aviveportId. -
Create a conditional link using
Viveport.Deeplink.GoToApp. -
While content is running,
Viveport.Deeplink.GetLaunchDatacan be called to get launch data for switching between titles.
-
Launch your title directly by calling
-
Call
Viveport.Api.Shutdownto release VIVEPORT SDK resources when no longer needed. In Unity, this is typically either in MonoBehaviorOnDestroy()or beforeApplication.Quit().