https://developer.apple.com/forums/thread/72271 之前 iOS10.3 beta2 移除掉了 iCloud keychain items 来防止 APP 追踪同一台设备,最后被很多开发者反对, iOS10.3 RC 之后又添加回去了.
In previous versions of iOS, the keychain data persisted even when the app was uninstalled and reinstalled on the device. After upgrading to iOS 10.3 beta 2, it appears as if deleting the app also deletes all associated keychain contents for that app. The code I'm using to interface with the keychain hasn't changed, and works with iOS 10.2. Is anyone else experiencing this behavior? I haven't had a chance to test this with 10.3 beta 1.
I've searched through related threads here:
https://forums.developer.apple.com/message/75464https://forums.developer.apple.com/message/112523The conclusion from the Apple staff member is that the persistence of the keychain data across apps re-installs is a side-effect of the implementation rather than a feature, and that the behavior should not be relied upon. Maybe they finally decided to update the implementation?
* 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.
--gc
在之前的 iOS 版本中,即使应用程序被卸载并重新安装在设备上,钥匙串数据仍然存在。在升级到 iOS 10.3 beta 2 之后,似乎删除应用程序还会删除与该应用程序关联的所有钥匙串内容。我用来与钥匙串进行交互的代码没有改变,并且可以在 iOS 10.2 上使用。有没有其他人遇到这种情况?我还没有机会测试 10.3 beta 1 。
我在这里查找了相关帖子:
https://forums.developer.apple.com/message/75464https://forums.developer.apple.com/message/112523苹果员工得出的结论是,钥匙串数据在应用程序重新安装之间的持久性是实现的副作用,而不是功能,并且不应依赖这种行为。也许他们终于决定更新实现?
* 这是 iOS 10.3 中有意为之的更改,以保护用户隐私。在创建它的应用程序被删除后,不应将可以识别用户的信息留在设备上。
API 合同中从未规定应用程序创建的钥匙串项目在应用程序被删除时会保留。这一直是实现细节。
如果钥匙串项目与其他应用程序共享,那么在其他应用程序被删除之前,它不会被删除。
关于此更改的文档正在编写中,应该会解答本帖提出的问题。
--gc