Firebase:Auth.signInWithEmailAndPassword不存在

时间:2018-01-31 04:27:27

标签: ios firebase firebase-authentication

所以我一直在尝试设置默认登录系统(当我创建应用程序的其余部分时),所以现在我只想让我的应用程序使用我的凭据进行身份验证(只有1个用户,在开发中),但是我无法访问Firebase API所说的使用方法。

当我尝试调用该方法时,这就是自动完成所说的

What I see

基本上,寻找像这样的方法

Auth.auth().signIn(withEmail: email, password: password) { (user, error) in
  // code
}

2 个答案:

答案 0 :(得分:5)

  1. 确保您同时导入:

    import Firebase 
    
    import FirebaseAuth
    
  2. 要登录,请调用此函数并在完成处理程序中执行任务:

    FIRAuth.auth()?.signIn(withEmail: username, password: pass, completion: { (user, error) in
    
    })
    
  3. 注册,请执行以下操作:

    FIRAuth.auth()?.createUser(withEmail: "\(username)", password: "\(pass)", completion: { (user,error) in })
    

答案 1 :(得分:-1)

安装 angularfire2 这将解决问题