新安装的 iOS Google 应用程序如何在我第一次 运行 时知道我的帐户?

How does a newly installed iOS Google app know about my account the first time I run it?

假设我在 iPhone 上安装了一个 Google 应用程序(例如照片)并且我已经登录了它。

当我安装第二个 Google 应用程序(例如地图)并且第一次 运行 它时,它已经知道我的帐户并自动让我登录。

Google使用什么机制让新安装的应用程序自动知道我的所有帐户? iOS 提供的功能或 Google 提供的功能允许这样做吗?

实现此目的的一种方法是在 UIDevice.

上使用 identifierForVendor 属性

来自documentation

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

很可能 Google 使用钥匙串组在同一开发者帐户的多个应用程序之间共享钥匙串项(存储的用户名和密码)。这个过程在这里描述得很好:

http://evgenii.com/blog/sharing-keychain-in-ios/