I have an issue, that 5% of my users are registering to the server multiple times. This can only happen with a clean, new installation, because I perform a simple registration at the start: (pseudocode):
if(!SharedPrefs.contains(accessToken))
{
registerToServer(response -> {
SharedPrefs.save(response.accessToken);
SharedPrefs.save(); // commit, whatever
}
}
Then, I store his device UUID on the server.
As you can see, a user cannot be registered twice on the same device. The only way he can, is by reinstalling the app, because the SharedPrefs would be wiped.
But...
There are people who are registering twice, 3 times or even more. I can see that by filtering by the deviceID in my database and I have multiple user records with the same deviceID.
To solve that, I need to make sure, it is not some kind of bot (like Google Play pre-launch report devices).
The question
Is there any way, to get some kind of Unique Installation identifier, that will be identical only to the same Google Play installation event?
You'll probably say, that I could check that with SharedPrefs themselves, store some kind of bool "firstInstall" and it would be wiped with a new install. But I can't because I have assumptions that SharedPrefs are getting wiped somehow on app launch on these devices.
This happens mainly on some LG's, Samsung J5, "vivo vivo", Huaweis.