How can I get magnetometer sensor value from mobile?

I want to make a simple plugin that gets the magnetometer sensor(X,Y,Z) when I start at the mobile(both Android and IOS).
In this case, are there any function that get the magnetometer value in the UE4?
If so, what’s the name of the function and where it is included?

or should I use code android & ios separately? not c++?
If I want to get this from mobile, then i should use java and objective-c(or swift) and include it in the c++ code?

1 Like