question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change sent, received, seen status when send a message?

See original GitHub issue

Issue Description

When the user sends a message to another person he can include the sent, received, seen properties in the current message object but he can update each of them. Like once user press send sent all will be false. Then once the message added to the firebase then sent should be true, once another user receives this message received should be true, and once other users see this message ie message loaded on the visible screen seen status should change. I am unable to get at which event we should change these properties & how?

<GiftedChat
                    messages={this.state.messages}
                    onSend={messages => this.onSend(messages)}
                    user={{_id: this.state.user.id}}
                    messagesContainerStyle={{backgroundColor: '#fff'}}
                    renderMessage={this._renderMessage}
                    renderMessageText={this._renderMessageText}
                    renderAvatar={this._renderAvatar}
                    renderTime={()=>null}
                    renderDay={()=>null}
                    showUserAvatar={true}
                    showAvatarForEveryMessage={false}
                    renderBubble={this.renderBubble}
                    placeholder='Enter message'
                    renderInputToolbar={this._renderInputToolbar} 
                    textInputStyle={styles.textInputStyle}
                    renderActions={this._renderAction}
                    // minInputToolbarHeight={44}
                    alwaysShowSend={true}
                    renderSend={this._renderSend}
  />

Additional Information

  • React version:16.11.0
  • React Native version: 0.62.2
  • react-native-gifted-chat version: 0.16.1
  • Platform(s) (iOS, Android, or both?): Android (ios not tested)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
RupamShawcommented, Jun 23, 2020

@novlihalsi need to update message with

newMessage = {
          _id: chat.id,
          text: chat.chatMessage,
          createdAt: chatCreatedTime,
          user: {
            _id: userId,
            name: displayName,
            avatar: userAvatar,
          },
          sent: true,
          received: JSON.parse(`${chat.isRead}`),
        }

in giftedchat

<GiftedChat
renderTicks={this.renderTicks}
.....
/>
renderTicks=currentMessage=>{
    const tickedUser =  currentMessage.user._id
    return(

    <View>
    {!!currentMessage.sent && !!currentMessage.received && tickedUser===this.props.user.userId && this.props.user.userId && (<Text style={{color: 'gold', paddingRight:10}}>✓✓</Text>)}
    </View>
      )
  }
0reactions
stale[bot]commented, Jul 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add and request read receipts and delivery notifications
Open the original message that you sent with a request for a delivery or read receipt. This message is usually located in the...
Read more >
Change Messages notifications & settings - Google Support
Open the Messages app . · Tap More options More and then Settings and then Advanced. Send a message or a file separately...
Read more >
How to Turn Off Read Receipts on iMessage - Alphr
You just need to look at your chat history and find the last unanswered message you sent to your contact. If you don't...
Read more >
Change iMessage settings in Messages on Mac - Apple Support
Specify how you can be reached for messages and if you want to send read ... The person receives messages sent from the...
Read more >
How to check read receipts | WhatsApp Help Center
Check marks will appear next to each message you send. Here's what each one indicates: The message was successfully sent. The message was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found