3
votes

I need to have a identifier for each mobile device, which is sent to the server in all requests. Security is not a big issue here (we don't want the user to have to login). Not having the application rejected for any breach of terms, is however.

I was initially looking at https://code.google.com/p/actionscript-uuid/ which looks like it would be nice and easy to implement:

import com.laiyonghao.Uuid;

var uuid:Uuid = new Uuid();
trace(uuid);

Having an install related id, rather than a device specific id would not be a massive problem apart from the fact that we are going to be doing a version 2 of the application, which we need to have the same uid.

Will there be any issues saving state information on android / ios using shared objects?

If an application is updated will it still be able to access the same shared object?

I believe that apple will now reject any apps which attempt to use the MAC address.

I found openudid:

http://blog.appsfire.com/with-udid-nearing-its-demise-leading-industry-players-turn-to-openudid/

https://github.com/ylechelle/OpenUDID

I haven't seen a native extension written which uses this though. Having the unique identifier device specific rather than install specific is preferential as long as it's not too time consuming.

Is there a native extension available which allows a device specific unique identifier to be accessed which works cross platform?

I found the following question which is quite similar AIR 3.5 Mobile project device ID

Another thought I have had is we are going to be using push notifications in our application which may provide us with a nice identifier, what will happen if push notifications are disabled though I'm not sure.

1

1 Answers

4
votes

On Android you should be using the ANDROID_ID property. It's a unique identifier generated by android when the device is first booted. It may change under certain circumstances but generally is the best unique id.

http://developer.android.com/reference/android/provider/Settings.Secure.html

Under iOS you have 2 options, an advertising identifier and a vendor identifier.

The vendor identifier is unique but identical between apps from the same developer. Whereas the identifierForAdvertising is unique to the device to be used for advertising related calls.

https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html

All of these are available through the Application native extension in the distriqt ANE package:

http://airnativeextensions.com/extension/com.distriqt.Application

In particular the Application extension:

http://docs.airnativeextensions.com/application/docs/