Search code examples
iossafariwebkituser-agentudid

Force user to open my website in ios safari only


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 :)


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