Created
October 10, 2021 16:25
-
-
Save hieptl/cb2b89e784d1bdb9a87bc00038a0f549 to your computer and use it in GitHub Desktop.
SignUp.js - Create a New CometChat Account - React Native Gifted 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 = `${cometChatConfig.cometChatAuthKey}`; | |
// 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 => { | |
showMessage('Info', `${userCrendentials.user.email} was created successfully! Please sign in with your created account`); | |
setIsLoading(false); | |
}, error => { | |
console.log(error); | |
setIsLoading(false); | |
} | |
) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment