You should use cookies to store a value that the popup has been shown then add check to your popup that if the cookie exists then don't display the popup. I updated your code to reflect the changes you need to make, goodluck :)
<script type="text/javascript">
if( /iPad|iPhone/i.test(navigator.userAgent) ) {
//cookie name mypopup not found so display the popup
if(!getCookie("mypopup")){
setCookie("mypopup",true); //sets the cookie mypopup
var url=confirm("Would you like to download our mobile application?");
if (url==true)
{
var url = window.location.href = 'http://itunes.apple.com/us/app/AppId';
url.show();
}else{
}
}
}
//function to retrieve cookie value
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length,c.length);
}
}
return "";
}
//function to set the cookie
function setCookie(cname, cvalue) {
document.cookie = cname + "=" + cvalue + "; ";
}
</script>