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

User Events is not found in Dart PubNub Package #42

Closed
subodh-commits opened this issue Apr 15, 2021 · 2 comments
Closed

User Events is not found in Dart PubNub Package #42

subodh-commits opened this issue Apr 15, 2021 · 2 comments
Assignees
Labels
status: done This issue is considered resolved. type: question This issue is a question.

Comments

@subodh-commits
Copy link

User events are triggered when user metadata is set or deleted. Other users can receive these events by subscribing to the user's channel or if they are members of the same channel. In flutter PubNub package presently does not have such event handler who can handle update event.

@subodh-commits subodh-commits changed the title User Events is not found Dart PubNub Paclage User Events is not found in Dart PubNub Package Apr 15, 2021
@are
Copy link
Contributor

are commented Apr 15, 2021

Hi!

In Dart SDK all messages that are sent through the PubNub network are received through the Subscription class. There is no separate event handler for each event type. However, each message in the subscription.messages stream has a messageType property that tells you what kind of message it is. In case of Objects events, the messageType will equal to MessageType.objects.

To create a stream with only Objects events, you can do something like this:

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

var objectEvents = subscription.messages.where((envelope) => envelope.messageType == MessageType.objects);

Let me know if that answers your question.

@are are self-assigned this Apr 15, 2021
@are are added status: waiting This issue waits for feedback from author. type: question This issue is a question. labels Apr 15, 2021
@subodh-commits
Copy link
Author

Okk Thank you sir..it works for me.

@are are added status: done This issue is considered resolved. and removed status: waiting This issue waits for feedback from author. labels Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: done This issue is considered resolved. type: question This issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants