I want to prevent a user from using an application on his device, even if he re-installed the application.
Can you guide me just on what approach should I follow in order to get a full ban on the target device ?
What I tried before ?
I tried a working way, which is generating a custom key id, then saving It locally with synchronization with my backend, so when there is a connection, it will check for that key id in the background, then act based on it, and even the app is offline, it's already saved on the local that this device should not use the app.
What's wrong with this way ?
the user can't use the app and this is what I want, unless the app is installed and then installed again, then the app will generate a new key id which will let the user use the app.
What I'm expecting ?
a way to prevent the user from using the app even if he tried to re-installed the app thousands of times.
I have an idea about it but I need some device-specific information that will never change on the device, so I can compare and act based on it, but, I don't actually know what this device information is called, or is there a way ( package ) to get it.
Any information will be so valuable to me.
Thank you
CodePudding user response:
For iOS, consider using flutter_secure_storage
. You can store your unique device ID in the iOS Keychain which should persist after uninstall.
Unfortunately, on Android, it seems the keys are cleared upon uninstall. I'm not familiar with the sandbox on modern versions of Android, but I believe it may be possible to request permission to write to a directory and store data there. Otherwise, you might be able to add hasFragileUserData
to the AndroidManifest.xml
which would allow the user to choose to keep data after uninstalling the app.