cancel
Showing results for 
Search instead for 
Did you mean: 

Entitlement check doesn't work

Anonymous
Not applicable
Hi, I'm trying to publish my app for Gear VR, build in Unity and I have issues with entitlement check. It works well in editor but doesn't in build. This is the code used to test entitlement:
using System;
using System.Collections;
using System.Collections.Generic;
using Oculus.Platform;
using UnityEngine;

public class AppEntitlementCheck : MonoBehaviour {


public GameObject sphere;
public GameObject cube;
public GameObject cube_2;

void Awake() {
cube_2.SetActive(true);
try
{
Core.AsyncInitialize("1944699388876497");
Entitlements.IsUserEntitledToApplication().OnComplete(GetEntitlementCallback);

}
catch (UnityException e)
{
sphere.SetActive(true);
Debug.LogError("Platform failed to initialize due to exception");
Debug.LogException(e);
UnityEngine.Application.Quit();
}
}


void GetEntitlementCallback(Message msg)
{
if (msg.IsError)
{
Debug.LogError("You are NOT entitled to use this app.");
UnityEngine.Application.Quit();
sphere.SetActive(true);
}
else
{
Debug.Log("Enjoy :)");
cube.SetActive(true);
}
}

}
*random objects are there just to test it on Gear VR*

It's look like Unity just ignores all commands that uses Oculus Platform, because the first object shows...

Thanks for your Tips,

Sam 



4 REPLIES 4

mouse_bear
Retired Support
@"FULLEYE.NET"

Welcome to the Oculus Developer Forum!

I'll reach out to our internal engineering team for insight. Once they respond, I'll update you here.
If you need immediate help or want additional support/context on an issue you are having with our platform or integrations:

1. Gather any and all logs, screenshots, and version numbers of relevant software (Oculus SDK, engine, etc.)
2. Please submit a ticket here through the "Contact Us" link (include what you've gathered in step 1).
3. Tag me @mouse_bear once you have done so!

Anonymous
Not applicable
@NinjaGaijin

Thank you for your answer, I hope they will figure out it soon.

Sam

ravindersaxena
Honored Guest
We are facing the exact same issue. Our app has been submitted 2 times. We have tested internally through Alpha and Beta channels but no luck so far and no quick response from the Oculus team. It seems to be a known issue and for no reason they are going to hold the game to be released on the store.

Anonymous
Not applicable
Hi, remove UnityEngine.Application.Quit() so that  sphere.SetActive(trueis executed.