I have an meteor app that is deployed for both ios and android device and i want certain code to run on only ios device and not on android. I know that I can detect device using navigator.userAgent but this will only work if i have my app running on browser.
//This works if its a browser
navigator.userAgent.toLowerCase().indexOf("android") > -1;
But is there any possible way to detect device if i have created bundle for android using meteor cordova plugin so it works like a native app.
As Nijil Nair suggested use the Cordova Device Plugin . If you need help adding the plugin see Meteor Cordova . Once the plugin is properly installed you can use var devicePlatform = device.platform;
which will return one of the following based on the device: