Forum Discussion
Tr1NgleBoss
3 years agoHonored Guest
Problems with getting Oculus ID from Oculus.Platform.Users.GetLoggedInUser() [Copy from PCVR Help]
Hi. Im making game rn, and trying to add own database-based cloud storage. So i need to get Oculus ID of each player to send it to database. And its working perfectly in Unity Editor, but when im trying to do same thing in Quest - its just returning null, and there is no errors.
Can someone help me? And i actually think that this problem is because of Platform.Core.Initialize(id), but idrk.
There is my code btw:
public static string OculusUserID = "";
private void Start()
{
Oculus.Platform.Core.Initialize();
Entitlements.IsUserEntitledToApplication().OnComplete(EntitlementCallback);
}
void EntitlementCallback(Message msg)
{
if (msg.IsError) // User failed entitlement check
{
Debug.LogError("You are NOT entitled to use this app.");
UnityEngine.Application.Quit();
}
else
{
Oculus.Platform.Users.GetLoggedInUser().OnComplete(GetOculusUserIDCallback);
Debug.Log("You are entitled to use this app.");
}
}
private void GetOculusUserIDCallback(Message<Oculus.Platform.Models.User> callback)
{
if (callback.IsError)
{
OculusUserID = "Error:" + callback.GetError().Message;
}
else
{
OculusUserID = callback.Data.OculusID;
}
}
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
- 1 year ago
- 8 months ago