All,
I have this function to retrieve an unique device ID:
By debugging it works. It works also flawlessy when I deploy the App on the iPhone, the device ID is always the same and is unique even when I delete the App from the iPhone and then re-install it from within B4I.
So far, so good. In this way I've build a score table in the cloud, using that ID as unique identifier of an user. I though, this ID remains unique and so a returned user, which re-install the app, will be again recognized using that ID.
With my big surprise, after I uploaded the (same) App to iTunes, the ID I get each time I re-install the app an run it, is always different ! You may imagine the side effect: the score table is completely screwed up, since it is based on the uniqueness of the DeviceID.
Am I missing something obvious here ? Why the same function returns always - as expected - the same ID at each reinstall when I deploy it directly on the iPhone, but when I dowload the (same) App from iTunes I get different IDs each time I re-install it ?
To summarize:
Development scenario
- I deploy from within B4I the app on the device
- run the App, get a device ID
- uninstall the app
- reinstall the app
- run the App, get the same device ID - as expected
iTunes scenario:
- I download the App from iTunes and install it on the device
- run the App, get a device ID
- I uninstall the App from the device
- I download agein the App from iTunes and install it on the device
- run the App, get a different device ID
Any help would greatly appreciated.
Sergio
I have this function to retrieve an unique device ID:
B4X:
Sub GetDeviceId As String
Dim no As NativeObject
no = no.Initialize("UIDevice").RunMethod("currentDevice", Null)
Dim id As Object = no.GetField("identifierForVendor").GetField("UUIDString")
MyDeviceID = id
Return id
End Sub
So far, so good. In this way I've build a score table in the cloud, using that ID as unique identifier of an user. I though, this ID remains unique and so a returned user, which re-install the app, will be again recognized using that ID.
With my big surprise, after I uploaded the (same) App to iTunes, the ID I get each time I re-install the app an run it, is always different ! You may imagine the side effect: the score table is completely screwed up, since it is based on the uniqueness of the DeviceID.
Am I missing something obvious here ? Why the same function returns always - as expected - the same ID at each reinstall when I deploy it directly on the iPhone, but when I dowload the (same) App from iTunes I get different IDs each time I re-install it ?
To summarize:
Development scenario
- I deploy from within B4I the app on the device
- run the App, get a device ID
- uninstall the app
- reinstall the app
- run the App, get the same device ID - as expected
iTunes scenario:
- I download the App from iTunes and install it on the device
- run the App, get a device ID
- I uninstall the App from the device
- I download agein the App from iTunes and install it on the device
- run the App, get a different device ID
Any help would greatly appreciated.
Sergio