Friends,
I need help getting device id (UUID). I tried to find it several days.I read so many different forum topics. I read many web pages. I looked so many tutorials. I tried so many different way, and I can’t get the device id.
My current way (ref):
In controllers.js
.controller('PageCtrl', function($ionicPlatform, $scope, $cordovaDevice) {
$ionicPlatform.ready(function() {
$scope.$apply(function() {
// sometimes binding does not work!
// getting device infor from $cordovaDevice
var device = $cordovaDevice.getDevice();
$scope.manufacturer = device.manufacturer;
$scope.model = device.model;
$scope.platform = device.platform;
$scope.uuid = device.uuid;
});
});
})
I already did these following steps:
- ionic cordova plugin add cordova-plugin-device
- npm install --save @ionic-native/device
- ionic cordova run ios
Note: I exported the code from ionic Creator (v1). I have added ionic native javascript along with ng-cordova as well. I also added [‘ngCordova’] to angular.module.
I need ionic native javascript for my geolocation. It works with geolocation.
Please advise.
Thank you