Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Device

Improve this doc

Access information about the underlying device and platform.

Repo: https://github.com/apache/cordova-plugin-device

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-device
    $ npm install --save @ionic-native/device@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Device } from '@ionic-native/device';

constructor(private device: Device) { }

...

console.log('Device UUID is: ' + this.device.uuid);

Instance Members

cordova

Get the version of Cordova running on the device.

model

The device.model returns the name of the device’s model or product. The value is set by the device manufacturer and may be different across versions of the same product.

platform

Get the device’s operating system name.

uuid

Get the device’s Universally Unique Identifier (UUID).

version

Get the operating system version.

manufacturer

Get the device’s manufacturer.

isVirtual

Whether the device is running on a simulator.

serial

Get the device hardware serial number.

API

Native

General