iospressure

iOS: Get current atmospheric pressure from iPhone 6 with M8 chip


As I understand the official Apple documentation it's only possible to get the relative altitude change out of the new M8 chip which is in every new iPhone 6 and 6 plus.

What I need is the current atomspheric pressure (absolute value is fine, I do not need a relative value based on sea level). there is an app in the store which exatly does this, but I've no clue how to get this data out of my iPhone 6.

https://itunes.apple.com/us/app/barometer++/id922220265?mt=8

Could you point me in the correct direction?


Solution

  • I've taken a quick look at the documentation, and in CMAltitudeData there's a pressure method that returns the current atmospheric pressure in kilopascals: CMAltitudeData for the reference, it's just at the bottom.