cancel
Showing results for 
Search instead for 
Did you mean: 

Entitlement check - bug in the initialize code?

Anonymous
Not applicable
I'm working on a Gear VR game in Unity and I bumped into this problem with the Entitlement check. I was testing to see if the check actually works before sending my game for review and Oculus.Platform.Core.Initialize(id) throws an exception when the game is not entitled:

09-27 12:50:24.751   776   789 I Unity   : UnityException: Oculus Platform failed to initialize.
09-27
12:50:24.751   776   789 I Unity   :   at
Oculus.Platform.Core.Initialize(System.String appId) [0x00000] in
<filename unknown>:0

To test the above, I created a second Oculus account not entitled to use my game. I should mention that it works fine with accounts that are entitled to play the game (including my own). I'm using OVRPlatformSDK_v1.7.0, which I believe is the latest.

As a work around, I currently catch the exception and assume that the user is not entitled if an exception was thrown... but I don't really like that because it is dirty...

Did I miss something? Should we use a different library for the Gear VR? I believe the latest documentation mentions that the same code should work for both Rift and Gear VR. I'm using:

Oculus.Platform.Core.Initialize(myiD);
Oculus.Platform.Entitlements.IsUserEntitledToApplication().OnComplete(myCallback);

And again, this works fine when the user is entitled.

Could there be a bug? Has anyone tested the code when their game is used by an entitled player?

Thanks for your help 🙂



1 ACCEPTED SOLUTION

Accepted Solutions

delphinius81
Level 8
I use 5.4.1 and this has been working for me since 5.3.x releases.

View solution in original post

8 REPLIES 8

delphinius81
Level 8
I'll have to check on my end as my code does exactly the same thing as you. I don't remember running into this kind of exception though when I tested. The one thing I do differently though is I provide my appIDs through the unity editor instead of in code, but that shouldn't make a difference. Platform initialization should only depend on your app id being valid, and not on whether the user is entitled to the app. Are you sure you are using the correct app id? I remember in the other thread you tried putting in a fake id for testing purposes.

Anonymous
Not applicable
Yes, you are right, providing the ID through Unity or directly shouldn't make a difference... But who knows? maybe I should try that instead...

I think the ID is correct because if I login with my entitled account then it works. I stopped using a fake ID because I started getting that exception, I initially thought that core.initialize was throwing an exception because of that fake ID and assumed that it was happening because, well, that  ID didn't exist in the Oculus database. When I switched to the correct ID, to my surprise, it was also throwing an exception in the case of non-entitlement...

Just Curious, Delphinius, what version of Unity do you use? I don't think this would be the issue but I use 5.2.4 for this Gear VR project...

delphinius81
Level 8
I use 5.4.1 and this has been working for me since 5.3.x releases.

Anonymous
Not applicable
I see, maybe that's the issue... I'll run some tests with the latest version and see if I get the same result. Arg! I initially stuck to 5.2.4 because I had sound and perfornance issues beyond this version, may have to bite the bullet at some point. Thanks fot your help 🙂

A1_Mandeep
Level 2
Hey Guys, having the same issue, I am creating an app using platform sdk but when try to initialize get the same error.
Did somebody was able to find the solution to this. I am using Unity 2017.2.0 b11 with Utilities sdk 1.18.1 and platform sdk 1.18.

keelo
Level 2
I'm also seeing this error, whether I specify my app ID in the function call, or through the settings asset. The message is totally unhelpful as to what is going on 🙂 Any ideas???

SxKx
Level 5
I´ve tried to get my EntitlementCheck working for GearVR but haven´t got any way to prove it works on the device.
In Unity editor code runs and displays the prompt i created for the user straight up and exits, but running the app on the device logged in on different accounts and running straight from the file always clears the Entitlement check and never fails it.
 I´m pretty frustrated since it should be pretty straight forward function. Is it broken in GearVR or is there something I´ve missed completely?

Using Unity 2017.1.1.1

BizarreJelly
Level 2
SxKx said:


I´ve tried to get my EntitlementCheck working for GearVR but haven´t got any way to prove it works on the device.
In Unity editor code runs and displays the prompt i created for the user straight up and exits, but running the app on the device logged in on different accounts and running straight from the file always clears the Entitlement check and never fails it.
 I´m pretty frustrated since it should be pretty straight forward function. Is it broken in GearVR or is there something I´ve missed completely?

Using Unity 2017.1.1.1

 I'm running into the same problem you're having. Did you ever find out what was wrong?