How to serialize an app for a device?

Hello,

I need a way where I can provide a serial number that will only work on one device at a time. I was going to use the device ID but I read that it is not reliable and is either not fully supported or it changes per build. I know I cannot get the user’s phone number and I cannot rely on them to enter it because they may enter the same phone number on more than one device. I have a SQL server I am storing these in and will verify against. So do you know of any unique information I can use per device? The only way I am thinking is to generate a unique number with os.time() and adding a random number on the end and save it on the device and on the SQL server to compare. The user would never see it. Any better way?

Thanks,

Warren

The problem is that you need to generate an ID which is unique to the device, but as you say the device ID can change so you can’t use that. If you generate one yourself manually, and the user then uninstalls and then reinstalls your app, any ID you have generated will no longer be saved locally so the device will have a “new” device ID which won’t match the one on your server.

Could you not use a login method of some sort (e.g. Facebook)?  

The problem is that you need to generate an ID which is unique to the device, but as you say the device ID can change so you can’t use that. If you generate one yourself manually, and the user then uninstalls and then reinstalls your app, any ID you have generated will no longer be saved locally so the device will have a “new” device ID which won’t match the one on your server.

Could you not use a login method of some sort (e.g. Facebook)?