Created
December 23, 2021 07:01
-
-
Save MahdiKarimipour/d1ab34a92a536225d3cc9011cdcd9b4a to your computer and use it in GitHub Desktop.
Pellerex Realtime Messaging Send Message Method
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
| 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