You want to prevent receiving your “own” message. This is typical for broadcast messaging. You can see the Stackoverflow - How to stop receiving my own messages in PubNub.
You can filter ("stop receiving") by your own messages in PubNub by filtering. We have implemented a server-side filtering feature which you can use to prevent messages that are generated by a user to be also received by the user. Today this isn’t yet available and in a future release of PubNub we will provider filtering features server-side.
Client-side Filtering Option available right now!
Server-side Filtering not available... yet!.
You can easily include a
uuid per message published where the
uuid is associated with the publisher user. Upon receiving a broadcast message you can check the
message['uuid'] and ignore if necessary; for example if it is your own UUID
my_uuid == message['uuid'].