How to id iphone device type
What's the best way to tell iPhone devices – 2G, 3G, 3GS and the 4 aparted? My goal is to query remote xml data by device type, so to return more or less data depend of device capability.
None of those gives me enough info…
alert(Titanium.Platform.name + Titanium.Platform.osname + Titanium.Platform.ostype + Titanium.Platform.version )
4 Answers
-
not the whole answer you want to hear…. but just fyi…
if (Titanium.Platform.name == 'iPhone OS'){
Ti.API.info('——– entering iPHONE ———-');
};if (Ti.Platform.name == "android"){
Ti.API.info('——– entering ANDROID ———-');};
-
Thanks,
Yeah, i know and i've been using this to tell iPad apart, those sample in Kitchen sink doesn't work for me….
Titanium.Platform.model.indexOf('iPad')!=-1
-
I am getting a fatal error on Continuous 1.5.0 on ANDROID when I call this:
Ti.Platform.name -
if you know the width of the device in which app is installed, then you can put condition on width as below.
if(Titanium.Platform.displayCaps.platformWidth == '320') { //Iphone Configurations } if(Titanium.Platform.displayCaps.platformWidth == '480') { //Android Configurations } if(Titanium.Platform.displayCaps.platformWidth == '768') { //Ipad Configurations }