Skip to main content
New Participant
September 5, 2018

No Oculus Entitlement callbacks being recieved

I am trying to test this in editor for oculus go.
Here is a pic of my OculusPlatformSettings
     - I am using a test user that has been assigned to my application via the application manager on the oculus website

Here is the code:
void Awake () {
        Debug.Log("Core.IsInitialized: " + Core.IsInitialized());
        Oculus.Platform.Core.AsyncInitialize(Oculus.Platform.PlatformSettings.MobileAppID);
        Debug.Log("Core.IsInitialized: " + Core.IsInitialized());
        Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback);
        Debug.Log("AppID: " + Oculus.Platform.PlatformSettings.MobileAppID);
        testText.text = Oculus.Platform.PlatformSettings.MobileAppID;
    }

void EntitlementCallback(Message msg)
{
if (!msg.IsError)
{
//Debug.Log(msg);
testText.text = "Oculus entitlement check Successs";
// Entitlement check passed
}
else
{
Debug.Log(msg);// Entitlement check failed
Debug.LogError("Oculus entitlement check FAILED.");
//UnityEngine.Application.Quit();
}
}

This topic has been closed for replies.

1 reply

victoryvrAuthor
New Participant
September 6, 2018
I have updated the code a bit and am now receiving a callback for Initialize. The Callback msg is not an error as it reads.
Initialize Success: Oculus.Platform.MessageWithPlatformInitialize

 However i am not receiving an entitlement callback . Here is the full code.
using UnityEngine;
using Oculus.Platform;


public class Entitlement : MonoBehaviour
{

void Awake()
{
try
{
Core.AsyncInitialize().OnComplete(IntializeCallback);
Debug.Log("Initialized: " + Core.IsInitialized());
}
catch (UnityException e)
{
Debug.LogError("Platform failed to initialize to due exception.");
Debug.LogException(e);
// Immediately quit the application.
//UnityEngine.Application.Quit();
}
}
void IntializeCallback(Message msg)
{
if (msg.IsError)
{
Debug.LogError("Error: "+msg);
}
else
{
Debug.Log("Initialize Success: "+msg);
Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback);
}
}

void EntitlementCallback(Message msg)
{
Debug.Log("EntitlementCallback");
if (msg.IsError)
{
Debug.LogError("You are NOT entitled to use this app.");
//UnityEngine.Application.Quit();
}
else
{
Debug.Log("You are entitled to use this app.");
}
}
private void Update()
{
}
}