Hello, I just registered here, and saw your post, so let me reply!
You can use a code (put it in your .
js file) like this:
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { do some functions here, like make a cookie and put a message }
just replace iPhone / iPod what you want
Edit sorry, if you want to follow this with a message when they click OK to go to store:
if (confirm("Some message"))
window.location = "the app URL to go to, like itunes store...";