Created
October 18, 2021 14:08
-
-
Save hieptl/823d09d14ddbe47ca85187fa24428e53 to your computer and use it in GitHub Desktop.
SignUp.tsx - Register CometChat Account - Ionic Chat App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// cometchat auth key | |
const authKey = `${process.env.REACT_APP_COMETCHAT_AUTH_KEY}`; | |
// call cometchat service to register a new account. | |
const user = new cometChat.User(firebaseUid); | |
user.setName(fullname); | |
user.setAvatar(userAvatar); | |
cometChat.createUser(user, authKey).then( | |
(user: any) => { | |
alert(`${userCrendentials.user.email} was created successfully! Please sign in with your created account`); | |
setIsLoading(false); | |
}, (error: any) => { | |
setIsLoading(false); | |
} | |
) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment