Android 在ionic framework中使用cordova pludin获取设备id时出现问题
有谁能帮我在ionic framework中为混合应用程序使用cordova插件获取ios、windows和android设备的deviceid吗。因为我是这个混合应用程序开发的新手,在不止一项工作中,我都在努力解决这个问题。任何帮助都是可观的。 谢谢。看看 用法:Android 在ionic framework中使用cordova pludin获取设备id时出现问题,android,ios,windows,cordova,ionic-framework,Android,Ios,Windows,Cordova,Ionic Framework,有谁能帮我在ionic framework中为混合应用程序使用cordova插件获取ios、windows和android设备的deviceid吗。因为我是这个混合应用程序开发的新手,在不止一项工作中,我都在努力解决这个问题。任何帮助都是可观的。 谢谢。看看 用法: module.controller('MyCtrl', function($scope, $cordovaDevice) { document.addEventListener("deviceready", function ()
module.controller('MyCtrl', function($scope, $cordovaDevice) {
document.addEventListener("deviceready", function () {
var device = $cordovaDevice.getDevice();
var cordova = $cordovaDevice.getCordova();
var model = $cordovaDevice.getModel();
var platform = $cordovaDevice.getPlatform();
var uuid = $cordovaDevice.getUUID();
var version = $cordovaDevice.getVersion();
}, false);
})
看看,
用法:
module.controller('MyCtrl', function($scope, $cordovaDevice) {
document.addEventListener("deviceready", function () {
var device = $cordovaDevice.getDevice();
var cordova = $cordovaDevice.getCordova();
var model = $cordovaDevice.getModel();
var platform = $cordovaDevice.getPlatform();
var uuid = $cordovaDevice.getUUID();
var version = $cordovaDevice.getVersion();
}, false);
})
使用IDVPlugin:
cordova plugin add https://github.com/jcesarmobile/IDFVPlugin.git
在控制器中:
window.IDFVPlugin.getIdentifier(function(result){
alert(result);
},function(error){
alert(error);
});
资料来源:
使用IDVPlugin:
cordova plugin add https://github.com/jcesarmobile/IDFVPlugin.git
在控制器中:
window.IDFVPlugin.getIdentifier(function(result){
alert(result);
},function(error){
alert(error);
});
资料来源: