1
votes

I need to know the IMEI number of iOS devices, running my Codename One app.

Reading that, it seems it's not possible. Is it still impossible to get the IMEI number? And about the serial number? Any workaround to suggest?

1
You can get the UDID, but can not get the IMEI. Apple does not allow this. It is against security policy of ApplePPL
Has nothing to do with the hybrid tooling you are using. Its not possible to get it on iOS devices due to security issues.Simon McLoughlin
@PPL you can’t get the UDID either.Paulw11
As others have said even the UDID number returned is a pseudo number and will return a different value with every app install. That's an Apple restrictions...Shai Almog

1 Answers

3
votes

In general, iOS does not let you get at persistent unique identifiers (the IMEI, the UDID, the Wi-Fi MAC address, and so on) (source).

In the developer guide of Codename One, it's written:

Don’t use an app to get the UDID! Most return the wrong value, the official way to get the UDID is thru itunes.

If you need to identify uniquely the device, the best that you can do is to use the Codename One method Log.getUniqueDeviceId().

According to its Javadoc:

Returns a server generated unique device id that is cached locally and is only valid per application. Notice that this device id is specific to your application and to a specific install, it is guaranteed to be completely unique or -1 if unavailable (which can be due to a network error). Warning: this method might block while accessing the server!