You have to be careful.
On android 6+ imei can be null, if u didn't get permission. And alert with permission is very bad: its about permision to phone calls. A lot of users will block that permission (READ_PHONE_STATE).
I changed FPUniqueId to UDID because of that. I got a lot of devices with null id and a lot of time couldn't get why.
I have next with UDID now:
static private function get deviceId():String {
var _id:String = null;
if (!isMobile) return null;
if (isGrantedReadPhoneState) {
_id = UDID.telephonyManagerDeviceId;
}
if (!_id) {
if (UDID.OS == UDID.ANDROID) {
_id = UDID.androidId;
}
else if (UDID.OS == UDID.IOS) {
_id = UDID.vendorId;
}
}
return _id;
isGrantedReadPhoneState - flag for permission on Android, on iOS its false. There is next step to try to get id. If there is no permission UDID.androidId is better than null.