Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created October 10, 2021 16:25
Show Gist options
  • Save hieptl/cb2b89e784d1bdb9a87bc00038a0f549 to your computer and use it in GitHub Desktop.
Save hieptl/cb2b89e784d1bdb9a87bc00038a0f549 to your computer and use it in GitHub Desktop.
SignUp.js - Create a New CometChat Account - React Native Gifted Chat App
...
// 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