API reference

Core Class

The Core class provides methods for initializing and checking the status of the Oculus Platform SDK. This class is responsible for setting up the necessary components and configurations to enable communication with the Oculus Platform, allowing developers to access features such as Entitlement checks: Entitlement.getIsViewerEntitled(). 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

PlatformUninitializedError : String
Signature
String com.meta.horizon.platform.ovr.Core.PlatformUninitializedError

Static Methods

asyncInitialize ( context )
Asynchronously initialize Platform SDK.
This overload will attempt to read the Oculus App Id from the AndroidManifest.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized Request<PlatformInitialize> com.meta.horizon.platform.ovr.Core.asyncInitialize(Context context)
Parameters
context: Context  The Android Context to bind to the Platform.
Returns
synchronized Request< PlatformInitialize >  The request that can be used to register a callback and respond to the com.meta.horizon.platform.ovr.enums.PlatformInitializeResult in the payload.
asyncInitialize ( context , options )
Asynchronously initialize Platform SDK.
This overload will attempt to read the Oculus App Id from the AndroidManifest.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized Request<PlatformInitialize> com.meta.horizon.platform.ovr.Core.asyncInitialize(Context context, PlatformInitializeOptions options)
Parameters
context: Context  The Android Context to bind to the Platform.
options: PlatformInitializeOptions  The options used to configure the Platform.
Returns
synchronized Request< PlatformInitialize >  The request that can be used to register a callback and respond to the com.meta.horizon.platform.ovr.enums.PlatformInitializeResult in the payload.
asyncInitialize ( appID , context )
Asynchronously initialize Platform SDK.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized Request<PlatformInitialize> com.meta.horizon.platform.ovr.Core.asyncInitialize(String appID, Context context)
Parameters
appID: String  The Oculus App Id to use for the Platform.
context: Context  The Android Context to bind to the Platform.
Returns
synchronized Request< PlatformInitialize >  The request that can be used to register a callback and respond to the com.meta.horizon.platform.ovr.enums.PlatformInitializeResult in the payload.
asyncInitialize ( appID , context , options )
Asynchronously initialize Platform SDK.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized Request<PlatformInitialize> com.meta.horizon.platform.ovr.Core.asyncInitialize(String appID, Context context, PlatformInitializeOptions options)
Parameters
appID: String  The Oculus App Id to use for the Platform.
context: Context  The Android Context to bind to the Platform.
options: PlatformInitializeOptions  The options used to configure the Platform.
Returns
synchronized Request< PlatformInitialize >  The request that can be used to register a callback and respond to the com.meta.horizon.platform.ovr.enums.PlatformInitializeResult in the payload.
getLoggedInUserID ()
Signature
static long com.meta.horizon.platform.ovr.Core.getLoggedInUserID()
Returns
long
httpGetWithMessageType ( url , messageType )
Makes a HTTP GET request to the specified URL.
Signature
static long com.meta.horizon.platform.ovr.Core.httpGetWithMessageType(String url, MessageType messageType)
Parameters
url: String  The URL to make the request to.
messageType: MessageType  The Message::MessageType associated with the request.
Returns
long  The request ID associated with the request.
initialize ( context )
Synchronously initialize Platform SDK.
This overload will attempt to read the Oculus App Id from the AndroidManifest.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized boolean com.meta.horizon.platform.ovr.Core.initialize(Context context)
Parameters
context: Context  The Android Context to bind to the Platform.
Returns
synchronized boolean  true if the platform was successfully initialized, false otherwise.
initialize ( context , options )
Synchronously initialize Platform SDK.
This overload will attempt to read the Oculus App Id from the AndroidManifest.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized boolean com.meta.horizon.platform.ovr.Core.initialize(Context context, PlatformInitializeOptions options)
Parameters
context: Context  The Android Context to bind to the Platform.
options: PlatformInitializeOptions  The options used to configure the Platform.
Returns
synchronized boolean  true if the platform was successfully initialized, false otherwise.
initialize ( appID , context )
Synchronously initialize Platform SDK.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized boolean com.meta.horizon.platform.ovr.Core.initialize(String appID, Context context)
Parameters
appID: String  The Oculus App Id to use for the Platform.
context: Context  The Android Context to bind to the Platform.
Returns
synchronized boolean  true if the platform was successfully initialized, false otherwise.
initialize ( appID , context , options )
Synchronously initialize Platform SDK.
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: com.meta.horizon.platform.ovr.requests.UserAgeCategory#get() can be called immediately after asynchronous init and once platform is initialized, this request will run Synchronous functions will return the default value;
Signature
static synchronized boolean com.meta.horizon.platform.ovr.Core.initialize(String appID, Context context, PlatformInitializeOptions options)
Parameters
appID: String  The Oculus App Id to use for the Platform.
context: Context  The Android Context to bind to the Platform.
options: PlatformInitializeOptions  The options used to configure the Platform.
Returns
synchronized boolean  true if the platform was successfully initialized, false otherwise.
isInitialized ()
Returns true if the Platform has been initialized. If asyncInitialize(Context) is called, this will return true before the async initialization is complete.
Signature
static boolean com.meta.horizon.platform.ovr.Core.isInitialized()
Returns
boolean  true if the Platform has been initialized.
popSDKMessage ()
Pops the next message from the message queue.
Signature
static synchronized Message com.meta.horizon.platform.ovr.Core.popSDKMessage()
Returns
synchronized Message  the next Message, or null if there are no more messages.