title | description |
---|---|
JBDevice |
Get device information. |
基于cordova-plugin-device 2.0.3-dev版本修改
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 the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(device.cordova);
}
cordova plugin add cordova-plugin-jb-device
- cordova
- model
- platform
- uniqueid
- version
- manufacturer
- isVirtual
- idfa
cordova.plugins.JBDevice.getInfo(function(info){
var html = "
设备上的cordova版本:" + info.cordova +
"
设备名称:" + info.model +
"
设备平台系统:" + info.platform +
"
设备唯一标识符" + info.uniqueid +
"
设备平台操作系统版本号:" + info.version +
"
设备平台制造商:" + info.manufacturer+"
idfa:" + info.idfa ;
alert(html);
},function(error){
});