Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save MahdiKarimipour/d1ab34a92a536225d3cc9011cdcd9b4a to your computer and use it in GitHub Desktop.

Select an option

Save MahdiKarimipour/d1ab34a92a536225d3cc9011cdcd9b4a to your computer and use it in GitHub Desktop.
Pellerex Realtime Messaging Send Message Method
sendMessage = async (message) => {
let fromUserId = this.props.user.userId;
let toUserIds = this.props.parties?.filter(p => p !== fromUserId);
let chatGroupId = isEmpty(this.props.chatGroupId) ? this.state.chatGroupId : this.props.chatGroupId;
const data = {
message: message,
context: this.props.context,
chatGroupId: chatGroupId,
fromUserId: fromUserId,
toUserIds: toUserIds
};
const connection = this.state.connection;
connection.invoke("SendMessageToGroup", data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment