Armand
Posts: 0
Joined: Sat Jan 03, 2015 9:04 am

Developing one app for Android and IOS - different Javascript

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...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Developing one app for Android and IOS - different Javascript

Hi Armad,

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

Regards.

Return to “Issues”