Forum Discussion
foxvalleysoccer
4 years agoProtege
Entitlement Check issues
How do I test entitlement? I have this script on my opening screen. When I build and run on the device all I get is 3 dots. Remove the script my game loads. In my oculus settings I am logged ...
foxvalleysoccer
4 years agoProtege
I got entitlement check working with this script!
public class AppEntitlementCheck : 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();
}
}
// Called when the Oculus Platform completes the async entitlement check request and a result is available.
void EntitlementCallback(Message msg)
{
if (msg.IsError) // User failed entitlement check
{
// Implements a default behavior for an entitlement check failure -- log the failure and exit the app.
Debug.LogError("You are NOT entitled to use this app.");
UnityEngine.Application.Quit();
}
else // User passed entitlement check
{
// Log the succeeded entitlement check for debugging.
Debug.Log("You are entitled to use this app.");
}
}
}aedanundea
11 months agoHonored Guest
does it still work now? I'm building android apk for meta oculus
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 years ago
- 9 years ago
- 3 years ago
- 1 year ago