Skip to content

Instantly share code, notes, and snippets.

@danlynn
Created January 31, 2014 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlynn/8742360 to your computer and use it in GitHub Desktop.
Save danlynn/8742360 to your computer and use it in GitHub Desktop.
/**
* @returns {boolean} true if this is an iOS device running 'version' or greater
*/
function is_iOS_app_gte(version) {
return typeof window.device != "undefined" && window.device.platform == "iOS" && is_version_gte(window.device.version, version);
}
/**
* Is this an Apple iOS device and running version 7.0 or greater?
* @returns {boolean}
*/
function is_iOS_app_gte(version) {
var d = window.device;
if(typeof d != "undefined"){ // this checks if it's an app vs mobile site
if( d.platform == "iOS" ){
return is_version_gte(d.version, version);
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment