Gavin Miller
Gavin Miller

Reputation: 43855

How do you detect iPhone5 in PhoneGap?

Is there an easy way to detect if my app is running on an iPhone5?

Upvotes: 0

Views: 1334

Answers (2)

Nowned
Nowned

Reputation: 105

You probably want to use the build in device.model part of PhoneGap

http://docs.phonegap.com/en/2.3.0/cordova_device_device.model.md.html#device.model

Upvotes: 2

Gavin Miller
Gavin Miller

Reputation: 43855

Why yes, there is...

function isIphone5() {
  return device.name.match(/iPhone/i) != null && 
    window.innerWidth == 568 || window.innerHeight == 568;
}

Upvotes: 1

Related Questions