Firebase 无法在某些设备上配置和加载用户 运行 iOS 10

Firebase fails to configure and load the user on some devices running iOS 10

我正在尝试调试为什么 [FIRApp configure] 在某些设备上启动时无法加载保存的用户 运行 iOS 10.

Firebase SDK 使用的钥匙串似乎有问题。

我们将不胜感激。

配置“Firebase”时请参阅下面的日志

Error loading saved user when starting up: Error Domain=FIRAuthErrorDomain Code=17995 "An error occurred when accessing the keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary will contain more information about the error encountered" UserInfo={NSLocalizedDescription=An error occurred when accessing the keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary will contain more information about the error encountered, error_name=ERROR_KEYCHAIN_ERROR, NSLocalizedFailureReason=SecItemCopyMatching (0)}

找到问题了!在 .entitlements 文件中使用不同的包标识符进行生产和发布时,会导致 Keychain 退出用户。

您需要做的是为每个方案创建两个.entitlements 文件,并在构建设置中进行设置。