I am using FirebaseAuth on macOS. The below code works as expected. It prints uid to console on every app launch.
func applicationDidFinishLaunching(_ aNotification: Notification) {
FirebaseApp.configure()
Auth.auth().signInAnonymously { [weak self] result, error in
if let error = error {
debugPrint(error)
}
if let result = result {
debugPrint(result.user.uid)
}
}
}
But when using uid from currentUser property of the Auth class the system pops up dialog with the message App wants to use your confidential information stored in firebase_auth_1:blah:ios:blah.
func applicationDidFinishLaunching(_ aNotification: Notification) {
FirebaseApp.configure()
if let id = Auth.auth().currentUser?.uid {
debugPrint(id) // run `killall -9 SecurityAgent` to kill dialog
} else {
Auth.auth().signInAnonymously { [weak self] result, error in
if let error = error {
debugPrint(error)
}
if let result = result {
debugPrint(result.user.uid)
}
}
}
}
How to avoid this system popup when using currentUser property of the Auth class?
UPDATE 1 When launching App not from Xcode, but from Finder, the both versions of startup code, shown above, seems working without popping up system dialog. Looks like popup shown only when running app from Xcode.
UPDATE 2 The issue not in Auth.auth().currentUser usage. System shows popup every time when app recompiled. Seems it is depends of the Code signature, which may be different after compiling changes.

UPDATE 3 Seems issue was due Xcode setting "Signing Certificate: Sign to Run Locally". Explicitly setting "Provisioning Profile" and "Signing Certificate" solves an issue.

