cancel
Showing results for 
Search instead for 
Did you mean: 

S2S Api calls working as standalone in Unity editor but not when running on Oculus Go / Gear VR

bobbagoose
Explorer
I've been developing a simple arcade shooter and I've implemented a simple leaderboard. The leaderboard is able to poll the Oculus leaderboard server within Unity when I'm logged in as a standalone user on my account, but when I run the same code on my Oculus Go the server always returns a fail. AFAIK I'm passing the entitlement check since I've implemented code to alert me if this is not the case. The build has been loaded into Alpha and I've also tried RC channels but I'm still encountering the same issue.

It's frustrating since I know the code is good since it works within Unity, but never once have I been able to access the leaderboard on my test unit.

My entitlement check is exactly the code listed here https://developer.oculus.com/blog/unity-engine-entitlement-checks-for-gear-vr-and-rift/
And my leaderboard code is based on the hoops example, which is working in Unity to write and read scores successfully.

I realise this isn't much to go on but I don't know where else to turn now. I hope it's something obvious I'm not doing and someone out there knows how to help me.
Thanks
2 REPLIES 2

bobbagoose
Explorer
So I think the line that's causing me issues is this:
Leaderboards.GetEntries(USER_SCORE, TOP_N_COUNT, LeaderboardFilterType.None,
          LeaderboardStartAt.Top).OnComplete(HighScoreGetEntriesCallback);

It returns this when I try and access it. The error doesn't appear when I use standalone credentials.
NullReferenceException: Object reference not set to an instance of an object

EDIT: So Core.AsyncInitialize(); is failing on my Go. My app ID is correct and it's in a release channel and I'm running the build I've downloaded from the store. I'll keep digging into it but I'm really. not sure where I've gone wrong.

EDIT2: I've tried creating a brand new app, with a. new appID and I'm still not passing entitlement. I've stripped the entitlement check down to a barebones implementation and embedded it directly into my leaderboard script so I can ensure it runs before calling the leaderboard.

N.b. I'm using 
leaderboardConstructor.LeaderBoardError() to display the output in the game.

It's not even running CheckEntitlement() as AsyncInit has failed and it's caught with the error, displaying "Failed" in the game.



 private void Start()
    {
        try{
            Core.AsyncInitialize();
            CheckEntitlement();
            leaderboardConstructor.LeaderBoardError("Getting scores...");
        } catch {
            leaderboardConstructor.LeaderBoardError("FAILED");
        }
    }

    void CheckEntitlement()
    {
        Entitlements.IsUserEntitledToApplication().OnComplete(
        (Message msg) =>
        {
            if (msg.IsError)
            {
                // User is NOT entitled.
                Debug.Log("Error: User not entitled");
                UnityEngine.Application.Quit();
            }
            else
            {
                // User IS entitled
                Debug.Log("Success: User entitled");
                CheckForUpdates();
            }
        }
    );
    }



Edit 3: I've tried a build with IL2CPP as I read this fixed the issue for another developer in the same boat. No dice. My Android api levels are 21 min, 23 max. I deployed a build with Core.Initialize, instead of AsyncInitialize - same issue.

bobbagoose
Explorer
This post is my saviour:
https://forums.oculusvr.com/community/discussion/67548/entitlement-check-completes-but-vrc-validator...

I just need to update my platform SDK since I was using the version from Unity store. It didn't even register to check this since everything else was working flawlessly. I'm so happy now, I'm getting a beer.