Skip to main content

Receiving polls

To be able to receive new poll messages you need to implement a method onPollUpdates() method from callback DytePollEventsListener:

To get poll updates, listen to onPollUpdates() callback:


class PollEventsListeners extends DytePollEventsListener {

...


void onPollUpdates(List<DytePollMessage> polls) {
/// code to handle polls
}


void onNewPoll(DytePollMessage poll) {
/// code to handle new poll
}

...
}

You can subscribe to this events by addPollEventsListener method:

dyteClient.addPollEventsListener(PollEventsListeners());