Ionic 2 : Get device's informations

507 Views Asked by At

I try to get the device's information in a component but I don't know how to do that. I tried this :

console.log(Device.device.model);

But it return "undifined".

How can I get this information ?

1

There are 1 best solutions below

1
On BEST ANSWER

Have you install plugin?

ionic plugin add cordova-plugin-device


import { Device } from 'ionic-native';


console.log('Device: ' + Device);

Read more on http://ionicframework.com/docs/v2/native/device/