Deeplink API¶
Introduction¶
The Deeplink APIs allows you to launch the app you want or go to store instead if the user does not buy or install the content.
Note
Deeplink API are supported on both Android and PC after SDK 1.7.16 and VIVEPORT Desktop version 1.3.11(r12)
Function Spec¶
-
void IsReady(StatusCallback callback)
Initialize Deeplink API.
API parameters:
Name | Class | Description |
---|---|---|
callback | StatusCallback | callback function |
-
void GoToApp(StatusCallback2 callback, string viveportId, string launchData)
Launch a specific content by VIVEPORT ID, and send the launchData to it.
API parameters:
Name | Type | Description |
---|---|---|
callback | StatusCallback2 | callback function |
viveportId | string | VIVEPORT ID of content |
launchData | string | launch parameter |
-
void GoToApp(StatusCallback2 callback, string viveportId, string launchData, string branchName)
Launch a specific content by Viveport ID, and send the launchData to it. Set the target branch name if the user may install beta version and production version at the same time.
API parameters:
Name | Type | Description |
---|---|---|
callback | StatusCallback2 | callback function |
viveportId | string | VIVEPORT ID of content |
launchData | string | launch parameter |
branchName | string | launch “BETA” or “PROD” Version |
-
void GoToStore(StatusCallback2 callback, string viveportId)
Launch the store and go to the specific detail page by VIVEPORT ID. Use an empty string for viveportId in the API’s argument, to go back the store which launched your title.
API parameters:
Name | Type | Description |
---|---|---|
callback | StatusCallback2 | callback function |
viveportId | string | VIVEPORT ID of content. The default value is empty |
-
void GoToAppOrGoToStore(StatusCallback2 callback, string viveportId, string launchData)
The API will combine the features of above two APIs. It will automatically detect whether the user buys or installs the content, then launch this content or go to the store detail page.
API parameters:
Name | Type | Description |
---|---|---|
callback | StatusCallback2 | callback function |
viveportId | string | VIVEPORT ID of content |
-
string GetAppLaunchData()
The launch data input in the parameter of GoToApp
can be gotton through the API. It can be used in specific level of the content.
API Return: string
Type | Description |
---|---|
string | the parameter of launchData input in the GoToApp API |
Error code¶
Error Code | Description & Trouble Shooting |
---|---|
0 | Success, no error |
50001 | Invalid account id/VIVEPORT id/VIVEPORT key |
50004 | Cannot connect to server |
60300 | Content is not installed |
60310 | VIVEPORT ID doesn’t exist or the internet was diconnected |
80002 | User does not login VIVEPORT account |
Best Practice¶
Attention
- To get VIVEPORT ID and VIVEPORT Key correctly from the VIVEPORT developer console.
- To use Top Level API -
Viveport.Api.Init
to initialize VIVEPORT platform. For Unity developer, it is usually used in MonoBehaviour “Start()”. - To use DRM API -
Viveport.Api.GetLicense
to verify whether current user is allowed to launch the content. It is usually used in where to check the user’s authentication. Show an error message and close the content if getting the error code from the API. - To use Deeplink API -
Viveport.Deeplink.GoToApp
to directly launch the content by using the VIVEPORT ID assigned. - To use Deeplink API -
Viveport.Deeplink.GoToStore
to go to the store detail page to remind user to buy / install the content. - To use Deeplink API -
Viveport.Deeplink.GoToAppOrGoToStore
to decide the API is going to launch content or going to store depending on the user’s purchase status. - To use Deeplink API -
Viveport.Deeplink.GetAppLaunchData
to get the launch data that can be used to switch level or something while content is launching. - To use Top Level API -
Viveport.Api.Shutdown
to shutdown and release VIVEPORT SDK resources. For Unity developer, it is usually used in MonoBehaviour “OnDestroy()” or before Application.Quit(). - The API will launch current installed APP if the contents are in the production and beta environment at the same time.
Before testing¶
Go to VIVEPORT website and download VIVEPORT desktop application.
Install the downloaded file
ViveportSetup.exe
and follow the step by step to complete the setup process.On the PC desktop, a VIVEPORT icon will be there. Double click to launch it and sign in as your developer account.
![]()
Important
You could also see the Error Codes and Trouble Shooting pages to know what to do when you got problems using the VIVEPORT SDK.