Platform v15 Reference Guide

OVR_Requests_ApplicationLifecycle.h File Reference

Detailed Description

The Application Lifecycle APIs are designed to help you manage application state within the Oculus Runtime (PC only right now). As of writing this, the only interesting cases here revolve around Universal Windows Platform (UWP) Applications.

UWP applications ship in two parts: launcher and implementation. However, the Oculus runtime only knows about the application it launched. We now provide a way to register the second application with our runtime.

The launcher will need to request a SessionKey from the Runtime using ovr_ApplicationLifecycle_GetSessionKey();
The launcher will then need to that session key to the second application. The second application will then need to register itself using the session key using: ovr_ApplicationLifecycle_RegisterSessionKey(char * sessionKey)
The second application will now be able to communicate with the runtime.

Function Documentation

ovrRequest ovr_ApplicationLifecycle_GetRegisteredPIDs ( )
Return a list of all the pids that we know are registered to your application.
A message with type ovrMessage_ApplicationLifecycle_GetRegisteredPIDs will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type ovrPidArrayHandle. Extract the payload from the message handle with ovr_Message_GetPidArray().
ovrRequest ovr_ApplicationLifecycle_GetSessionKey ( )
The launcher, which we know and trust can use this to create a key, pass it to the UWP app, which will be able to register using it as the original application.
A message with type ovrMessage_ApplicationLifecycle_GetSessionKey will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
If no error occurred, the message will contain a payload of type const char *. Extract the payload from the message handle with ovr_Message_GetString().
ovrRequest ovr_ApplicationLifecycle_RegisterSessionKey ( const char * sessionKey )
The actual UWP app will be able to register as the original application using the guid from getSessionKey() .
A message with type ovrMessage_ApplicationLifecycle_RegisterSessionKey will be generated in response.
First call ovr_Message_IsError() to check if an error occurred.
This response has no payload. If no error occured, the request was successful. Yay!
1
2
3
4
5
6
7
8
9
31
41
42
53
54
63
64
65
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!

#ifndef OVR_REQUESTS_APPLICATIONLIFECYCLE_H
#define OVR_REQUESTS_APPLICATIONLIFECYCLE_H

#include "OVR_Types.h"
#include "OVR_Platform_Defs.h"



OVRP_PUBLIC_FUNCTION(ovrRequest) ovr_ApplicationLifecycle_GetRegisteredPIDs();

OVRP_PUBLIC_FUNCTION(ovrRequest) ovr_ApplicationLifecycle_GetSessionKey();

OVRP_PUBLIC_FUNCTION(ovrRequest) ovr_ApplicationLifecycle_RegisterSessionKey(constchar *sessionKey);

#endif
The documentation for this file was generated from the following file: OVR_Requests_ApplicationLifecycle.h