iOS 10.3(目前还是beta版本)开始,保存在keychain中的App相关的数据,会随着应用的删除而被清除,重新安装App后将无法再从keychain中获取应用相关的数据。而10.3之前删除App并不会清理keychain中的对应数据。

如果希望App在重新安装后,仍然可以获取到之前的一些数据,则依赖于keychain的方案将变得不可靠。

不过,如果数据是在多个App间共享,则只有当所有相关的App都被删除后,才会删除keychain中的这些共享数据。

至于具体原由,可以参考iOS 10.3 Beta 2 autodeletes keychain items after application uninstall?

This is an intentional change in iOS 10.3 to protect user privacy. Information that can identify a user should not be left on the device after the app that created it has been removed.

It has never been a part of the API contract that keychain items created by an app would survive when the app is removed. This has always been an implementation detail.

If a keychain item is shared with other apps, it won’t be deleted until those other apps have been deleted as well.

There is documentation in the works about this change that should address questions raised in this thread.