System.getInfo("deviceID")

Hi all,

Basically, I have some sharing functionality in my app which allows users to share some content they created with up to 3 other devices of any type. I don’t want them sharing with more than this.

They have to sign up using a username and password to create a “share” account that lets them upoad content and then an ASP.Net script online checks with an online database that their credentials are correct and then saves the content to the server and returns a unique code the user can give to anyone they want to share their content with.

To ensure only 3 devices are shared with per account, I want to track the device IDs of any device that uses a code to download the content. Each time a new device is used then their “device count” for that account goes down by 1.

However - as I understand it, because of their privacy policy, Apple now reject apps where we try to track people’s device ID. Is this right?

If so, is there any other totally unique piece of information I can use to ensure that more than 3 devices aren’t used to download any one code…? I don’t want the people downloading the shared content to have to sign up - they should just be able to enter a code.

I know I could only allow 3 downloads maximum but this wouldn’t allow for people wanting to re-download in the future.

Thanks,

Ian


From the Corona Docs…

On iOS, “deviceID” returns a “unique” id for the device. Per Apple’s policies, on iOS 6 and later, “deviceID” returns a MD5 hash of the device’s “identifierForVendor” (see below); on iOS 5 it returns a MD5 of a GUID (Globally Unique Identifier) that is unique for each app install.

On Android, if your app uses the “android.permission.READ_PHONE_STATE” permission, the following will be returned:

  • IMEI for GSM phones.
  • MEID or ESN for CDMA phones.
  • The operating system’s unique ID for devices that are not phones.

If your Android app does  not  use the “android.permission.READ_PHONE_STATE” permission, then the operating system’s unique ID will be returned for all devices. Note that the operating system’s unique ID may change after re-installing the operating system on the device.

Unless I was not spotted, using system.getInfo(“deviceID”) should be perfectly fine… I use it to track/manage users for my push notification system on both android and ios.

Thanks for getting back to me. I saw this thread that suggested they may have a problem with it…

http://forums.coronalabs.com/topic/38680-systemgetinfodeviceid-broken-on-ios-in-the-build-20131196/

It’s going to be a lot of work for me to implement this feature so I need to be as sure as I can be that I’m not going to do it all for nothing.

Does anyone know anything else on this…?

As Tom said “This was changed in build 1196 to conform with Apple’s privacy policies” so any corona build’s above 1196+ will handle system.getInfo properly to follow Apple’s policies

Okay great. Yes - re-reading it I see that what Tom said is that an MD5 of the deviceID. As long as the same unique identifier is called every time I request system.getInfo(“deviceID”) that’s fine.

Thanks for the replies.

Unless I was not spotted, using system.getInfo(“deviceID”) should be perfectly fine… I use it to track/manage users for my push notification system on both android and ios.

Thanks for getting back to me. I saw this thread that suggested they may have a problem with it…

http://forums.coronalabs.com/topic/38680-systemgetinfodeviceid-broken-on-ios-in-the-build-20131196/

It’s going to be a lot of work for me to implement this feature so I need to be as sure as I can be that I’m not going to do it all for nothing.

Does anyone know anything else on this…?

As Tom said “This was changed in build 1196 to conform with Apple’s privacy policies” so any corona build’s above 1196+ will handle system.getInfo properly to follow Apple’s policies

Okay great. Yes - re-reading it I see that what Tom said is that an MD5 of the deviceID. As long as the same unique identifier is called every time I request system.getInfo(“deviceID”) that’s fine.

Thanks for the replies.

From what I can tell, this no longer returns a unique value from the same device. I can verify from testing as well as from a quick search online which stated that the identifierForVendor will change when the app is deleted and reinstalled

Are you saying that we now have no way of getting a totally unique value for a device?

If that’s the case then I’m in trouble… 3 months of work down the drain.

If anyone from Corona could shed some light on this that would be great.

Thanks.

Ian

There may be another solution - but I don’t fully understand the sharing with other devices. Is the content shared via your server using the special code (eg the code allows someone to view an image).

Could you not make everyone create an account and then limit access to the shared content based on a maximum of 3 user accounts?

From what I can tell, this no longer returns a unique value from the same device. I can verify from testing as well as from a quick search online which stated that the identifierForVendor will change when the app is deleted and reinstalled

Are you saying that we now have no way of getting a totally unique value for a device?

If that’s the case then I’m in trouble… 3 months of work down the drain.

If anyone from Corona could shed some light on this that would be great.

Thanks.

Ian

There may be another solution - but I don’t fully understand the sharing with other devices. Is the content shared via your server using the special code (eg the code allows someone to view an image).

Could you not make everyone create an account and then limit access to the shared content based on a maximum of 3 user accounts?