API reference
API reference
Select your platform
No SDKs available
No versions available

Core Class

The Core class provides methods for initializing and checking the status of the OculusPlatform SDK. This class is responsible for setting up the necessary components and configurations to enable communication with the OculusPlatform, allowing developers to access features such as Entitlement checks: Entitlements.IsUserEntitledToApplication(). The Core class also provides methods for checking the initialization status of the platform, allowing developers to determine whether the platform is ready for use.

Static Fields

LogMessages : bool
If true, the contents of each request response will be printed using Debug.Log. This can allocate a lot of heap memory, so it should only be used for testing and debugging purposes.
Signature
bool Oculus.Platform.Core.LogMessages
PlatformUninitializedError : string
The error message that will be displayed to the user if the platform is not initialized.
Signature
string Oculus.Platform.Core.PlatformUninitializedError

Static Methods

AsyncInitialize ( appId )
Asynchronously Initialize Platform SDK. The result will be the type of Models.PlatformInitialize.Result.
While the platform is in an initializing state, it's not fully functional. [Requests]: will queue up and run once platform is initialized. For example: Users.GetLoggedInUser() can be called immediately after asynchronous init and once platform is initialized, this request will run [Synchronous Methods]: will return the default value; For example: Users.GetLoggedInUser() will return 0 until platform is fully initialized.
Note that during initialization, some features may not be available or may return default values. It's important to check the initialization status before attempting to use certain features or functions. Use Message.IsError to check if the result is an error. Use Message.Type to check the message type. Use Models.PlatformInitialize.Result to get the result of the initialization.
Signature
static Request<Models.PlatformInitialize> Oculus.Platform.Core.AsyncInitialize(string appId=null)
Parameters
appId: string  The app ID to use for initialization. If null, the app ID will be retrieved from the OculusPlatform Settings.
AsyncInitialize ( accessToken , initConfigOptions , appId )
(BETA) For use on platforms where the Oculus service isn't running, with additional configuration options to pass in.
This method allows you to initialize the Platform SDK with custom settings, such as disabling P2P networking.
Example usage:
var config = new Dictionary<InitConfigOptions, bool>{ [InitConfigOptions.DisableP2pNetworking] = true }; Platform.Core.AsyncInitialize("{access_token}", config);
Note that this method is still in beta and may be subject to change. Use at your own risk.
Signature
static Request<Models.PlatformInitialize> Oculus.Platform.Core.AsyncInitialize(string accessToken, Dictionary< InitConfigOptions, bool > initConfigOptions, string appId=null)
Parameters
accessToken: string
initConfigOptions: Dictionary< InitConfigOptions, bool >
appId: string
Initialize ( appId )
Synchronously Initialize Platform SDK. The result will be the type of Models.PlatformInitialize.Result.
While the platform is in an initializing state, it's not fully functional. [Requests]: will queue up and run once platform is initialized. For example: Users.GetLoggedInUser() can be called immediately after synchronous init and once platform is initialized, this request will run [Synchronous Methods]: will return the default value; For example: Users.GetLoggedInUser() will return 0 until platform is fully initialized.
Note that during initialization, some features may not be available or may return default values. It's important to check the initialization status before attempting to use certain features or functions. Use Message.IsError to check if the result is an error. Use Message.Type to check the message type. Use Models.PlatformInitialize.Result to get the result of the initialization.
Signature
static void Oculus.Platform.Core.Initialize(string appId=null)
Parameters
appId: string  The app ID to use for initialization. If null, the app ID will be retrieved from the OculusPlatform Settings.
Returns
void
IsInitialized ()
Returns whether the OculusPlatform SDK has been successfully initialized. True if the platform is initialized, false otherwise.
Signature
static bool Oculus.Platform.Core.IsInitialized()
Returns
bool

Internal Static Methods

ForceInitialized ()
Signature
static void Oculus.Platform.Core.ForceInitialized()
Returns
void