1. It'll never work on iOS. To get a device id for iOS you need to plug it in and use libimobiledevice, which can get that information.
2. I think you have a bad idea. Sometimes, reinstalling is the only way to fix some issues, like a corrpupted* application database. Removing that ability wil lshoot yourself in the foot.
3. On android you could get a device id, but I always used a generated-1-time guid. I'm not sure what the status is on the android device identifier though. That's a stack exchange question.
4. Your application directory is perserved across updates.
5. Regardless, I don't think QSysInfo::machineUniqueId() is what you want. Reading the docs, it looks like a implementation of my GUID strategy. But having jsut run this on iOS, returns an empty string "If no unique ID could be determined, this function returns an empty byte array."
*Corrupted SQLITE databases get deleted on Android, this would have to be a application-level corruption.
Perhaps what you want is all the user data server side and not rely on the device? What is the behavior if the user has more than one device?
Sent: Wednesday, October 10, 2018 at 9:38 AM
From: "Jérôme Godbout" <godbo...@amotus.ca>
To: "Qt Interest" <interest@qt-project.org>
Subject: [Interest] [Android] Qt machine unique id
From: "Jérôme Godbout" <godbo...@amotus.ca>
To: "Qt Interest" <interest@qt-project.org>
Subject: [Interest] [Android] Qt machine unique id
Hi,
--
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interestwhat is the best way to identify a device even if os is updated or factory reset, etc?
My use case is the following:
- The user is used to identify itself and log in (security is managed with a secure connection to server from the application).
- I have some settings and device history on the server and I would like to tell the server the user is using which of his device automatically. I wish I would have this identification persistent over application update and reinstall.
- id persistent from factory reset might not be necessary.
- I would like it to work on Android, if possible on iOS too (iOS is not mandatory).
I was looking at QSysInfo::machineUniqueId(), but I'm not sure it will fit the bill, anyone have a good way to do this?
|
|
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest