I\'m trying to implement heart beat recording functionality in an app i\'m developing.
The preferred method of doing this is by using the iPhone\'s camera with the light
First addressing your finger-on-the-lens problem. When the finger is on the lens, you don't get a static black frame (as one might assume). The ambient light actually passes through your finger to create a reddish frame. Also, the blood flow pattern in the finger results in slight periodic variations in that red frame (try opening your camera app, placing your finger completely on the lens). Also, if the ambient light isn't enough, you can always turn on the camera flash/torch to compensate for that.
For an open source (and step by step) procedure, try:
http://www.ignaciomellado.es/blog/Measuring-heart-rate-with-a-smartphone-camera
also, I would advise you to read the following patent on pulse measurement:
http://www.google.com/patents/WO2013042070A1?cl=en