The magnetometer sensor in most phones responds to changes in the magnetic field around the phone. This sensor is most commonly used for the navigation features of phones, but it can also be used to identify the movement of ferrous objects around a phone, like vibrating steel beams or rotating machinery.
I measured the natural frequency of a steel cantilever beam to be 2.76 Hz using the PhyPhox app and magnetometer sensor on an iPhone 13 Pro. The phone was placed within 10 cm from the vibrating beam. After collecting the time history, I picked points at the top of the peaks of 7 cycles to find a time of 2.5389 seconds. Dividing by 7 yields a natural period of 0.3627 seconds, or a natural frequency of 2.76 Hz.