Page 1 of 1

Developing one app for Android and IOS - different Javascript

Posted: Wed Jan 07, 2015 6:31 pm
by Armand

Sometimes Android and IOS require different Javascript for an action i.e. for sms IOS use sms:xxxx&body= where android is sms:xxx?body
What is the best way to achieve this without developing two applications. Currently I am using the following Javascript to determine if the user is Android or IOS.

var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") -1; //&& ua.indexOf("mobile");
if(isAndroid) {
.....
}else {...

Obvious this ignores windows phone...


Developing one app for Android and IOS - different Javascript

Posted: Thu Jan 08, 2015 4:05 am
by Yurii Orishchuk

Hi Armad,

Right, you can use similar solution. Like this: http://stackoverflow.com/questions/12...

Regards.


Developing one app for Android and IOS - different Javascript

Posted: Thu Jan 08, 2015 5:22 am
by Armand

Thanks