Hi, We assume that when uninstalling an application, the UserDefaults are deleted.
Starting iOS16 we encounter complaints from clients that this is not the case. We have succeeded in debugging a device where this occurred (UserDefaults were not deleted after uninstall+install), but have not succeeded in recreating this issue on another device.
We assume this issue has a connection to iCloud sync, although UserDefaults iCloud synching should be specifically set up (using NSUbiquitousKeyValueStore) which we have NOT set. Or maybe it has to do with Family Sharing.
We are initializing the UserDefaults with suiteName for usage in widgets, but assume this has not connection to the bug.
The same happens on tvOS 17.0. It looks like it could be caused by OS not being fast enough when deleting user data. Perhaps OS schedules the data removal and it takes time for it to take effect. I had similar problem, but removing the app, installing again and deleting again solved the problem. If it is necessary to remove app and do fresh install, it is better to suggest to users removing the app waiting for a minute or rebooting device and then do the install.