Authentication
Introduction
Register a new user
let email = "MY EMAIL"; /** FIREBASE USER EMAIL **/
let password = "MY PASSWORD"; /** FIREBASE USER PASSWORD **/
ChatAuth.createUser(withEmail: email, password: password) { (user, error) in
if let user = user {
user.firstname = "FIRST NAME";
user.lastname = "LAST NAME";
let chatm = ChatManager.getInstance()
// always save the new user as a contact in remote contacts DB
chatm?.createContact(for: user, withCompletionBlock: { (error) in
print("Contact successfully created.")
// then initialize chat with the just created user
chatm?.start(with: user)
})
}
}Sign in with existing user
Sign in with Firebase
Custom authentication
Last updated