The Magnetometer API reads the raw magnetic field in microtesla on all three axes.
Earth's background is 25–65 µT depending on location. Objects containing ferromagnetic material
(steel, iron) or powered electronics distort this field at close range.
A sustained reading above 100 µT while stationary suggests a nearby anomaly. Above 200 µT is significant. A fridge motor reads ~500 µT at 5 cm. A transformerless power brick reads ~300 µT at 10 cm.
On iOS, permission must be requested via a user gesture — the "start sensor" button handles this.