Question

I have an UDID retrieval website which is dedicated to iOS devices and must be opened in mobile safari to download .mobileconfig profile. I am after a php or htaccess code to force/ask user to open my website in mobile Safari.

Appreciate your help :)

Was it helpful?

Solution

You can use the information about web browser contained in navigator object. The name and version are there.

var appname = window.navigator.appName;

Based on JavaScript Browser Detection

OTHER TIPS

This should be done with JavaScript. Create two div's. One with the mobile link to the profile and one that tells the user to open the site on their iOS Device. Then use JavaScript to show/hide them as necessary.

<script>
var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );

if (iOS) {
  document.getElementById("ifiOSHiddenDIV").style.display="true";
}
</script>

<!-- HTML-->
<div id="ifiOSHiddenDIV" />
Link to Mobile Provision
</div>

These links will also help:

Detect if device is iOS

Hide an html element using javascript only if browser is firefox

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top