Edit: Sorry for late Edit, Without two parameter you cannot calculate it, So first need to fill user Camera height from ground.
I have
@iphonemaclover. As many people have pointed out there's insufficient information to calculate this purely using trigonometry. However, depending on how accurate you need to be, or what it is you're trying to measure and other data you can expect to recover from an iphone and/or you're willing to make some assumptions, it is possible to make some inroads.
a) +1 to Martin R, if you assume a flat earth, a phone height (which as per the app you quoted) a user could update for calibration purposes, can recover pitch information and know where a point on the ground at the base of your object is then this is simple trig. Once there's a estimate for the distance and assuming the thing you're measuring is close to vertical (or sits at a known angle) then its height can also be calculated.
b) Your exif file contains face region information. If you're interested in people and are happy to make an assumption that they're an adult then you could use an average head size assumption to estimate distance using the method you've outlined already.
c) If you can recover a series of images and camera positions and the camera / object positions vary then I believe that 3d information can be recovered using projective geometry.