Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
6 years ago
Approved

Oculus SDK didn't callback for standalone

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

Replies have been turned off for this discussion