Reputation: 695
From Ionic doc I'm using ionic native device plugin to get my device id.
The problem is when I test app on computer (in Chrome browser) device id is null
. however when I run my app on mobile the it gives a unique alpha numeric string.
I want to know why it is null or computer. and is there any difference in device id and mac address. I think mac address is also a unique number for each device.
Upvotes: 1
Views: 2148
Reputation: 1
import {Device} from 'ionic-native';
platform.ready().then(() => {
console.log(Device.device.uuid);
}
try this if you still need it.(I guess No, but leave it here for somebody met the same problem)
Upvotes: 0
Reputation: 3249
Device
is never null.
If you run ionic emulate browser
you will get
cordova:"4.1.0"
isVirtual:null
manufacturer:"unknown"
model:"Chrome"
platform:"browser"
serial:"unknown"
uuid:null
version:"58.0.3029.110
Native plugin only works when using cordova (i.e. executing on a platform: ios, android, browser).
But when you only uses the webview ionic serve
then plugins are empty objects:
cordova:null
isVirtual:null
manufacturer:null
model:null
platform:null
serial:null
uuid:null
version:null
Upvotes: 3