Some other thoughts on accuracy:

no doubt the cheap magnetometers in an iPhone have limited absolute accuracy. Also, they are installed relative to the case with only so much accuracy. And if you use it in a vehicle, your mounting repeatability will only be so accurate. You would almost want to do a calibration on the ground where you taxi in a fixed heading (long enough to get a course from the location info) to determine the fixed offset between vehicle and compass.

I'm not that familiar with aircraft, but in my sailing days, I know a lot of effort went into making sure to only use non magnetic metals like aluminum and brass anywhere near the binnacle. 0

Given there are many components in an iPhone, including batteries, various metals, etc, one could imagine a rather complex relationship between applied magnetic field and measured direction. You might need to "swing" the compass to calibrate it. I think the built in calibration is comparing accelerometer to compass, which I think determines local orientation offset, or maybe computes a magnetometers correction vector, not sure if that ends up correcting an orientation dependant errors.