Using Cordova identify iOS device type iphone or ipad? -


i have submitted 1 ios application developed using cordova/sencha touch being rejected.

i have 1 functionality behave different iphone , ipad. using code identify device type :

ext.os.devicetype.tolowercase() == "phone" 

but returns "phone" if run app on ipad simulator.

so, how fix issue can submit app app store.

thanks.

on cordova use following functions detect platform:

function isandroid() {     return navigator.useragent.indexof("android") > 0; } function isios() {     return (isiphone() || isipad()); } function isiphone() {     return (navigator.useragent.indexof("iphone") > 0 || navigator.useragent.indexof("ipod") > 0) || $(window).width() <= 320; } function isipad() {     return navigator.useragent.indexof("ipad") > 0 || ($(window).width() <= 1000 && $(window).width() > 320); } 

the $(window).width() testing on desktop.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -