Detection of Apple devices (iphone 3GS, iphone 4, ipad, ipod, etc)
Is there a way to detect what apple device the app is currently running on at runtime?
I need to detect at least ipod, iphone 3 and 4 and ipad.
Thanks!
3 Answers
-
Accepted Answer
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform-module
architecture and model should help you.
-
var ab = Ti.Platform.model.split(' ');
if(ab[0] == 'iPhone') { alert(' fonud Iphone ') } else { alert('not Iphone'); }
you can find only iphone you can check ab[0]="iPhone " if this not work
-
var ab = Ti.Platform.model;
var ipn = ab.search('iPhone');
if(ipn == 0) { alert(iphone found);
}
//you can detect any iphone using above code