Yes, I too was surprised to find an app where, despite the warning when deleting the app that all data would be deleted too, a reinstall retains all account information and data. The app I encountered does not use iCloud at all. I’m guessing it stores an identifying token in the device keychain and uses that token to retrieve data from a server.
According to Apple Developer Technical Support person ‘Quinn “The Eskimo!”’
on the Apple Developer Forums,
- This is currently expected behaviour despite being ‘an obvious privacy concern’
- Apple tried to fix this around 2017 but enough app developers complained that they decided to keep it
- However, Apple could theoretically fix this in the future without warning
For now, it seems that completely wiping your device before re-installing apps is the only practical way to go. And don’t restore from a backup after wiping either, as the backup could contain the old keychain data.
To quote some of the details Quinn ‘The Eskimo’ gave:
First, a timeline:
- All versions of iOS prior to 10.3 beta preserve keychain items when an app
is deleted.
IMPORTANT This was most definitely an implementation detail of the
original iOS keychain. Our keychain documentation has never specified what
would happen in this case.
10.3 beta included a change that deleted such items.
That caused compatibility problems (apps were relying on the existing
behaviour, even though it wasn’t documented), so it was rolled back
before 10.3 GM.
iOS 11 introduced the DeviceCheck framework, which provides a forward path
for one of the most common legitimate use cases of this behaviour. For
more info on this, see WWDC 2017 Session 702 Privacy and Your Apps.
Second, preserving keychain items on delete is an obvious privacy concern. As
far as I know Apple has not made any specific announcements as to how we
intend to resolve this issue (1). However, I don’t think it would surprise
anyone if the 10.3 behaviour returned at some point in the future. I would
hope that we’d be more proactive about announcing such a change -- for
example, talking about it at WWDC -- but, as always, I can’t make any
promises about The Future™.