I am seeing this from the usual smartphone sensors. These sensors (Android here e.g.) take the magnetic field data as input. That is okay, but some phones do not have a magnetic field sensor (they cannot display a usual compass app e.g.).
Now they still have a gyroscope? This device, AFAIK, lets the app determine the position of the device in X, Y and Z direction (or even with more axes). This sounds as if I could also use it as a compass. Maybe it needs to be calibrated one time, so I know that some vector is the vector pointing north, but then
So could apps use this? Or if not: Why can't they?
Basically that is just a question for whether this fallback/workaround for phones without magnetic sensors is possible. You can assume any other "usual" sensors in nowadays smartphones to be available, so when you need an additional sensor or e.g. GPS, assume you can use that.