Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageAction event listener for updating delivery and read receipts #9

Closed
devopsokdone opened this issue Jul 23, 2020 · 1 comment
Closed
Assignees
Labels
status: waiting This issue waits for feedback from author. type: question This issue is a question.

Comments

@devopsokdone
Copy link

Our use-case involves all recipients in the channel to send a Delivery and Read receipt for each received message, to the message sender. Like we have in popular messengers like Whatsapp.

We have used message transaction type messageAction for the same and able to update message as delivered and read on the server, once this is done server needs to relay this message to message sender client where delivery and read receipt need to be updated in the sent message record.

As per documentation of PubNub Event Listeners - Use event listener message action events that are published to notify clients when Message Actions are added to or removed from messages. To receive these events, clients should be subscribed to the channel, and add a messageAction listener.

We tried to implement messageAction listener but this option does not exist in Dart SDK or we may be missing something. For us message delivery and read receipts features are critical and we would like to implement it using messageAction, please suggest how this can be achieved with Dart SDK.

@mohitpubnub
Copy link
Contributor

mohitpubnub commented Jul 24, 2020

Hi, thanks for drawing our attention!
Subscription will get the event messages for messageAction operations.
From dart v1.4.1 onwards, To filter out notifications, You can try something like:

  var subscription = await pubnub.subscribe(channels: {'my_channel'});

  subscription.messages.listen((envelope) {
    if (envelope.messageType == MessageType.messageAction) {
      // Do something with messageAction event data
      // print(envelope.payload['data']);
    }
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting This issue waits for feedback from author. type: question This issue is a question.
Projects
None yet
Development

No branches or pull requests

3 participants