Example usage
The following example highlights how a developer might use the VIVEPORT Subscription 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(). -
Call
Viveport.Subscription.IsReadyto initialize the subscription API and to make sure there is a connection to the VIVEPORT platform. -
Do any of the following:
-
Call
Viveport.Subscription.IsWindowsSubscriberto determine if the end user is a Windows subscriber. -
Call
Viveport.Subscription.IsAndroidSubscriberto determine if the end user is an Android subscriber. -
Call
Viveport.Subscription.SubscriptionTransactionTypeto determine which kind of subscription the end user has.
-
Call
-
Call
Viveport.Api.Shutdownto release VIVEPORT SDK resources when no longer needed. In Unity, this is typically either in MonoBehaviorOnDestroy()or beforeApplication.Quit().