How to detect device model & OS version?

I want to get user’s the device model, OS version and screen resolution from my Cordova clients. Kadira does this beautifully.

How do I do this in my app? Is there an existing package?

Thanks

There are a lot of npm packages doing that. Device as an example

You could try out this cordova plugin - https://github.com/apache/cordova-plugin-device

Hi guys, thanks for your help. I opted for a trivial answer without any Cordova plugins or Meteor packages:

var device_info = window.navigator.userAgent;
var display_size = screen.width + 'x' + screen.height;

device_info looks something like “Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/50.0.2661.86 Mobile Safari/537.36”,

Quick and dirty, but all the information is in there and there are no Cordova native plugins to go wrong. The plugins cannot be hot code pushed and would have necessitated all my deployed users to upgrade from App Stores.

1 Like