Hi Perry, thanks for the answer.
Yes, regarding what Apple want or not about the people/device identification is absolutely clear for me. Also I know that using Objective-C I can get everything I need, but I have not Corona Enterprise and above all I have not the time to write a plugin at the moment.
After a lot of time spent investigating about some lua based solutions I relized that is not feasible, at least for my lua skills.
Then I have tried another quick and dirty solution that is working now.
I collect all the informations I can get regarding the device and I put all in a long string including the name of the device.
Then I get the MD5 from the long string using an external MD5 module. https://github.com/kikito/md5.lua
I believe that the crypto.md5 can be also used to perform this, but I’ not sure if crypto perform padding on long strings, this is the reason I’m using an external module.
Then I can use the generated MD5 as a new UUID.
I know that this is a “not so elegant” way and not a complete workaround because the user can try to change the name of the device and then reuse the app vote function, but I’m confident that not all the users will know or do this !!!
Of course this is working for me and is not valid for Android where the “deviceID” work fine.
This is the code I’m using:
local myApp = require( "myapp" ) local md5 = require( "md5" ) local platformName = system.getInfo( "platformName" ) local platformVersion = system.getInfo( "platformVersion" ) local maxTextureSize = system.getInfo( "maxTextureSize" ) local deviceiD = system.getInfo( "deviceID" ) local model = system.getInfo( "model" ) local architectureInfo = system.getInfo( "architectureInfo" ) local name = system.getInfo( "name" ) print ("platformName --\> ", platformName) print ("platformVersion --\> ", platformVersion) print ("maxTextureSize --\> ", maxTextureSize) print ("deviceiD --\> ", deviceiD) print ("model --\> ", model) print ("architectureInfo --\> ", architectureInfo) print ("name --\> ", name) if ( platformName == "Android" ) then myApp.uuid = deviceiD else -- iOS local longIds = platformName..platformVersion..maxTextureSize..model..architectureInfo..name print( "Long string for MD5 -\> ", longIds ) myApp.uuid = md5.sumhexa(longIds) -- returns a hex string print( "Encoded MD5 -\> ", myApp.uuid ) end
Bye.
Ale