If I hold a strong neodymium magnet near my iPhone while the compass app is running, there is no effect whatsoever on the compass bearing. It doesn't matter where I hold the magnet in relation to the phone, or which way the magnet itself is oriented.
It also doesn't matter if I hold the magnet near the phone before I start the compass app (I thought perhaps that the compass app might take an initial bearing and then use the phone's gyroscopes to calculate offsets from this).
How is this possible?