Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active June 1, 2019 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchetaWern/531517cbc56e79e75fccea74d3790a78 to your computer and use it in GitHub Desktop.
Save anchetaWern/531517cbc56e79e75fccea74d3790a78 to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: Initialize Stream chat
// src/screens/Chat.js
async componentDidMount() {
this.props.navigation.setParams({
showUsersModal: this.showUsersModal
});
try {
const user = await client.setUser(
{
id: this.user_id,
name: this.username,
image: `https://ui-avatars.com/api/?background=d88413&color=FFF&name=${this.username}`,
},
this.user_token
);
// next: add channel member
// next: subscribe to channel
} catch (err) {
console.log("error: ", err);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment