Get some type of identifier for a mobile device with Ionic, ngCordova?

0

I need to obtain an ID or some kind of unique identifier of a mobile device where I install my APP, if someone knows how to do this I would greatly appreciate your help.

    
asked by Dagg 01.02.2017 в 22:58
source

2 answers

0

Yes, there are several ways:

  • The imei = The only problem is that it only allows in android since in ios there is no permission to access.

  • The mac = The problem would be in ios 8 that assigns a random mac.

  • The uuid = is a unique universal identifier of 16 bytes. It is the one that I recommend, it is compatible with android, ios and all platforms. First you need to install the cordova plugin

sudo cordova plugin add org.apache.cordova.device

and then use it to get the id

$ionicPlatform.ready(function {
  console.log(ionic.Platform.device());
});
I hope it helps you. Greetings. Pd: keep in mind that if you execute ionic serve you will not be able to obtain this identifier, be sure to perform the tests with physical devices     
answered by 02.02.2017 / 11:51
source
0

The only problem is that uuid changes once you have uninstalled and reinstalled, so far I have not found any way to generate a unique uuid. greetings

    
answered by 27.02.2018 в 15:58