The purpose of the plugin is to provide a consumer friendly device model of Android devices. I used jaredrummler's gist to crete the plugin.
Using the plugin is so simple. After installation, you will have an object called devicemodel
in the global context.
In order to get the device model, use the identify
method as below:
devicemodel.identify(function(err, data) {
if (err) return console.log('Opps, error');
console.log(data.model);
});
In order to install the plugin you can simply use the following Cordova CLI command:
cordova plugin add https://github.com/mertdogar/cordova-android-devicemodel
The plugin only works for Android platform. In iOS, device model can easy be obtained using this plugin.
It is Apache License, Version 2.0. Feel free to fork the project and send pull requests if you have any.