Magnetometer

Access the device magnetometer sensor(s) to respond to measure the changes in the magnetic field. You can access the calibrated values with Expo.Magnetometer.and uncalibrated raw values with Expo.MagnetometerUncalibrated.

Expo.Magnetometer.addListener(listener)

Subscribe for updates to the Magnetometer.

Arguments

listener (function) -- A callback that is invoked when an Magnetometer update is available. When invoked, the listener is provided a single argumument that is an object containing keys x, y, z.

Returns

An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener.