Skip to content

Instantly share code, notes, and snippets.

@baskeboler
Last active December 27, 2016 05:29
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 baskeboler/293cbe4f872f72ee52ff3b3ae9b15dd6 to your computer and use it in GitHub Desktop.
Save baskeboler/293cbe4f872f72ee52ff3b3ae9b15dd6 to your computer and use it in GitHub Desktop.
checking if we are on iphone 6 plus or higher with cordova device.model
var modelString = device.model;
var modelRegex = /\d+/g;
var isIPhone6PlusOrHigher = false;
var match = modelString.match(modelRegex);
if (match != null) {
var major = match[0], minor = match[1];
if (major == 7) {
if (minor != 2) {
// iphone 6 plus
isIPhone6PlusOrHigher = true;
}
} else if (major > 7) {
isIPhone6PlusOrHigher = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment