Forum Discussion
Zenchess
6 years agoHonored Guest
Entitlement check callback not triggering?
Hello. I have a basic project set up, have set the avatar app id and platform app id , and am using a test user that i created on the developer website for my app.
I am using the following code as shown somewhere in the documentation:
I am using the following code as shown somewhere in the documentation:
using UnityEngine;
using Oculus.Platform;
public class EntitlementCheck: MonoBehaviour {
void Awake ()
{
try
{
Core.AsyncInitialize();
Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback);
}
catch(UnityException e)
{
Debug.LogError("Platform failed to initialize due to exception.");
Debug.LogException(e);
// Immediately quit the application.
UnityEngine.Application.Quit();
}
}
void EntitlementCallback (Message msg)
{
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.");
}
}
}
However when I attach this script to a gameobject and run the project, the callback is never triggered The catch block isn't being executed either. Am I doing something wrong? I have verified that the code in Awake is being executed by debugging in rider.
However when I attach this script to a gameobject and run the project, the callback is never triggered The catch block isn't being executed either. Am I doing something wrong? I have verified that the code in Awake is being executed by debugging in rider.
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago
- 4 years ago