How to get the serial number of a VR device Oculus Rift/Quest/2/Pro

Can anyone point me on how to get the serial number of the VR Device i am using in blueprints or in C++ code. I tried using Get Device ID node in blueprints but, I only get an empty string and when I try to use Get Device Type I get ‘Rift’ or ‘Quest 2’ accordingly on witch device I use. I tried googling this and looked trough Meta documentation nothing pops up.

I am using Unreal Engine 4.27.

I found partially a solution for this, it’s not what i was looking for but it will work for me i hope someone will find this helpfull.

You’ll need to get the source from the engine(that was for me the only way to be able to import the functionality that i needed) and change the project to use the source engine. in the build.cs of the project add “Android Permissions” for the dependency
ex:

PublicDependencyModuleNames.AddRange(new string { “Core”, “CoreUObject”, “Engine”, “InputCore”, “AndroidPermission” });

compile the code, and after that you can use

‘’ # include “Android/AndroidPlatformMisc.h”

to use included code for getting information about your device that uses android for for example for me Oculus Quest 2, but it will not get the ID of the Oculus Rift because i think it’s based for Windows and not Android.
In your code use this call

FAndroidMisc::GetDeviceId();

to get the id in string format.

While researching the code in the AndroidPlatformMisc.CPP I found out there are some logic that is returning empty strings for example if you want to get the MAC address it returns an empty string and you will need to create your own custom function and modify the engine to get the information that you’re looking for.

I am putting this here because I’ve invested quite a bit of time to find this out i hope this will help someone .

:handshake:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.