firebase uid always return nil

cristan lika

Her is my database/rules:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

i am trying both way it is give me nil

 FIRAuth.auth()?.createUser(withEmail: email, password: pass, completion: { (firuser, error) in
      
     if error != nil {
    print("error goes when try to user authenticated :) \(error)")
  }
  
  print("firuser : \(firuser)")

  print("FIRAuth.auth()?.currentUser?.uid : \(FIRAuth.auth()?.currentUser?.uid)")
  
  print("firuser?.uid : \(firuser?.uid)")
  
  guard let userUID = firuser?.uid  else{
     print("user UID  not found. should go stackoverflow ")
  return
  }
      
      guard let userUID = firuser?.uid  else{
         print("user UID  not found. should go stackoverflow ")
      return
      }
})

console log :

error :

Optional(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=SecItemAdd (-34018)})

firuser : nil
FIRAuth.auth()?.currentUser?.uid : nil
firuser?.uid : nil

server user added :

enter image description here

Quiet Islet

i was faced same problem ..but solve this way

Go to your *.xcodeproj

Go to the tab "Capabilities"

Activate "Keychain Sharing"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related