jxcore/jxcore-cordova

Detecting if we are on Android, iOS or Desktop

yaronyg opened this issue · 4 comments

For testing purposes it would be really nice if there was an interface we could call that could tell us if we are on Android, iOS or a desktop OS.

Right now we are hacking up something involving detecting if the Mobile object is defined but this is really futzy. It would be nice to have a Client object (I keep saying, Mobile is a bad name) and we could do Client.deviceType and get back an object that returned things like Hardware, OS, Version, etc.

Hi, you may use process.platform which is "android" or "ios" on mobiles. Also jxcore.utils.OSInfo() returns some useful data.

Besides http://jxcore.com/docs/jxcore-utils.html#osinfo
P.S. @ktrzeciaknubisa docs needs an update

Indeed. Updated.

Awesome! Thanks!