scan a QR in a WebApp running on an iPhone

Anyone knows how to implement in a WebApp running on an iphone a way to access the camera and automaticaly detects and scans a QR, like the WhatsApp application does in order to asociate the App with the WebApp ?
Thanks