问题
I am turning iOS app to Mac app, when I run Xcode for My Mac, I was trying to login my app on Mac, when I press button login, below Error shows:
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
MacOS: 10.15.1 Xcode: 11.2.1
It works totally fine on iPhone simulator or real iPhone, it only occurs when I try to run on Mac
I think this is a issue that Firebase does Auth does not really support Mac app that well.
PS: there is a question looks kind similar, but I don't really understand Firebase fails to configure and load the user on some devices running iOS 10
回答1:
Add Keychain Sharing Capability
to the target's build settings. More context here.
Click the + Capability and then choose Keychain Sharing Capability
来源:https://stackoverflow.com/questions/59061191/xcode-11-firebase-auth-for-mac-app-has-error-an-error-occurred-when-accessing-th