How to use the @cometchat-pro/react-native-chat.CometChat.endTyping function in @cometchat-pro/react-native-chat

To help you get started, we’ve selected a few @cometchat-pro/react-native-chat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cometchat-pro-samples / react-native-chat-app / chatApp / src / ChatScreen.js View on Github external
sendMessage() {
        console.log('Send message called =', this.state.txtMessage);
        var messageType = CometChat.MESSAGE_TYPE.TEXT;
        var receiverType = CometChat.RECEIVER_TYPE.USER;
        var textMessage = new CometChat.TextMessage(uid, this.state.txtMessage, receiverType);
        this.setState({
            txtMessage: ''
        })

        console.log("Send End typing called",textMessage)
        CometChat.endTyping(typingNotification);

        CometChat.sendMessage(textMessage).then(
            message => {
                console.log('cometchat send message', message);
                this.setState((state) => {
                    return state.messages.push(message)
                })
            },
            error => {
                console.log("Message sending failed with error:", error);
            }
        );
    }