cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus SDK didn't callback for standalone

Anonymous
Not applicable
Hi,

I am following the oculus unity standalone example code for entitlement check but it didn't callback. (Update: it works with a build but not in UnityEditor. The following issue only exists with UnityEditor)

try
{
Core.Initialize();
Debug.Log($"Oculus initialised {Oculus.Platform.Core.IsInitialized()}");
Request request = Entitlements.IsUserEntitledToApplication();
Debug.Log($"request id {request.RequestID}");
request.OnComplete((Message msg) =>
{
Debug.Log("Entitlement check finished");
if (msg.IsError)
{
// User is NOT entitled.
Debug.Log(msg.GetError().Message);
onFailed();
}
else
{
}
}
);
OVRPlugin.occlusionMesh = true;
}
catch (Exception ex)
{
Debug.Log("failed to init oculus", ex);
}
I added Debug.Log in Callback.HandleMessage(Message msg) in Oculus sdk and found the request id in Message was mismatched with the request id which was used to register the callback method by always 1 less. For example, if the request id for registry was 38, then the id in message for callback was 37.
internal static void OnComplete<T>(Request<T> request, Message<T>.Callback callback)
{
requestIDsToCallbacks[request.RequestID] = new RequestCallback<T>(callback);
}
if (requestIDsToCallbacks.TryGetValue(msg.RequestID, out callbackHolder))
{
....
}
Any idea what's wrong?

Thanks,

Ke

0 REPLIES 0