I am trying to get device id in ionic2 using typescript.
I installed cordova-plugin-device
And my code is....
platform.ready().then(() => {
console.log(device.cordova);
}
But this is not working.
When I launch the app on device, there is no any log.
Please help me.
Thank you!
It looks like this is in the Ionic 2 docs. What you need to do is import the Device
class from ionic-native
and call the uuid
property of the device
object.
For example
import {Device} from 'ionic-native';
platform.ready().then(() => {
console.log(Device.device.uuid);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With