GigaDroid / flutter_udid

Plugin to retrieve a persistent UDID across app reinstalls on iOS, Android, Mac, Windows & Linux.
MIT License
252 stars 53 forks source link

More than one uuid on ios #43

Open etdapt opened 1 year ago

etdapt commented 1 year ago

I have been using this for a while and discovered that ios keeps getting two different ids at different times for the same device. I haven't figured out what could have triggered the switch, I experimented with having CarPlay connected and disconnected but that doesn't seem to make the difference.

AGAIN, I didn't reset my phone/device or even upgrade ios

fairuzmn commented 11 months ago

+1

sulistiyono346 commented 11 months ago

+1

GigaDroid commented 11 months ago

Did you maybe login/logout of your iCloud account? Which iOS version are you all using? Interesting to see multiple people reporting this in such a short time span even though there was no change to the code for months.

etdapt commented 11 months ago

Discovered this since ios 16.x but also same in 17 ... no action of iCloud login/logout, it could simply be most of time it's giving the base UUID (i called it base when it's recognized most often), and then if the app is running in background (may be that's the condition) then it could be switched to use some alternative ones, and if killing the app to relaunch, it will switch back to use the base... Also, in my observation, the alternative one is just one, hence it feels like it's not randomly giving some other UUID but just some logic determines a condition that it should use the secondary one.

GigaDroid commented 11 months ago

That‘s interesting. I have a suspicion that something weird is going on with the Keychain then. To make sure the UDID persists across reinstalls it saves the UDID to the Keychain on the first run. If there is a UDID in the Keychain there’s a condition to just retrieve it from the Keychain instead of running the function to retrieve the UDID of the device. Would be interesting to see behaviour without this Keychain condition, as suggested in #33. Should be easy to implement, but I don’t have much time right now, if someone creates a PR for this I will merge it ASAP

zkang93 commented 4 months ago

+1

GigaDroid commented 4 months ago

Unfortunately I do not have time to fix this at the moment, if someone wants to dive into the iOS code, I'm open to review the PR. For now these are my thought what could be going wrong here:

privateNirvana commented 1 month ago

Has it been optimized and updated?

GigaDroid commented 1 month ago

Not yet, I don't have the time to look into this at the moment, still accepting PRs for it