xmtp / example-chat-react-native

ARCHIVED: See the README for alternative approaches to building an XMTP app with React Native.
MIT License
33 stars 5 forks source link

Streaming message feature #2

Closed HassenMabrouki closed 1 year ago

HassenMabrouki commented 1 year ago

Context

Attempting to use xmtp-js in React Native, I successfully integrate the SDK, I can send messages, and also get the messages list works fine.

Problem

Listen for new messages in a conversation it's not working

for await (const message of await conversation.streamMessages()) {
  if (message.senderAddress === xmtp.address) {
    // This message was sent from me
    continue
  }
  console.log(`New message from ${message.senderAddress}: ${message.content}`)
}

Screenshot

Screen Shot 2022-11-16 at 12 11 51 PM

Screen Shot 2022-11-16 at 12 14 23 PM

Expectation

As I followed the documentation, the expected result whenever I send a message from user A to user B, the message should be displayed for user B, but it is not the case for me.

I'll be so thankful If give us any hints to make this work. :)

elisealix22 commented 1 year ago

Duplicate of https://github.com/xmtp/xmtp-js/issues/223