How to get individual message in a room along with sender in ChatKit API?I used message.text and message.sendId but it doesnt seem to work!!I used a trick to get the message text but dont know how to get senderId?
Closed this issue · 1 comments
Pawan72 commented
componentDidMount() {
const chatManager = new ChatManager({
instanceLocator:instanceLocater,
userId: '',
tokenProvider: new TokenProvider({
url: tokenurl
})
})
chatManager.connect()
.then(currentUser => {
this.currentUser = currentUser;
console.log(currentUser);
this.currentUser.subscribeToRoomMultipart({
roomId: "",
hooks: {
onMessage: message => {
this.setState({
messages : [...this.state.messages,message.parts[0].payload.content]
})
console.log(message);
}
}
})
})
.catch(err => {
console.log('Error on connection', err)
})
this.setState({
})
}
minaorangina commented
Closing as stale, if this is still an issue please contact support@pusher.com for more help