This plugin defines a global device object, which describes the device’s hardware and software. Although the object is in the global scope, it is not available until after device event.

Properties

  • device.cordova
  • device.model
  • device.platform
  • device.uuid
  • device.version

These properties must be called after deviceready event fired to be sure that device can be fetched.

Quick Example

document.addEventListener(“deviceready”, callback, false);

function callback() {
  alert(
    “Device Cordova: ”+device.cordova+”\nDevice Model: ”+device.model+”\nDevice Platform: ”+device.platform+”\nDevice UUID: ”+device.uuid+”\nDevice Version: ”+device.version
  );
}

Source Documentation: http://plugins.cordova.io/#/package/org.apache.cordova.device

About The Author

Leave a Reply

Your email address will not be published. Required fields are marked *