所以我一直在尝试设置默认登录系统(当我创建应用程序的其余部分时),所以现在我只想让我的应用程序使用我的凭据进行身份验证(只有1个用户,在开发中),但是我无法访问Firebase API所说的使用方法。
当我尝试调用该方法时,这就是自动完成所说的
基本上,寻找像这样的方法
Auth.auth().signIn(withEmail: email, password: password) { (user, error) in
// code
}
答案 0 :(得分:5)
确保您同时导入:
import Firebase
import FirebaseAuth
要登录,请调用此函数并在完成处理程序中执行任务:
FIRAuth.auth()?.signIn(withEmail: username, password: pass, completion: { (user, error) in
})
注册,请执行以下操作:
FIRAuth.auth()?.createUser(withEmail: "\(username)", password: "\(pass)", completion: { (user,error) in })
答案 1 :(得分:-1)
安装 angularfire2 这将解决问题