0

pusher.trigger('presence-channel', 'my-event2', 'Hi', socket_id);

here I can not add multiple socket ids to exclude users in the above function.

is there any solution for, triggering an event to a single user? or excluding multiple recipients from that event ?. given their socket ids.

1 Answers1

0

Such a solution does not exist in Channels. If you need to send an event to a single user than the best approach would be to have each user subscribe to their own channel (e.g private-user-doydoy). You can then target this channel when triggering events.

If you need to exclude multiple recipients you can continue to use this approach, sending events only to those who need it.

doydoy
  • 4,021
  • 3
  • 20
  • 33