Publish/Subscribe API for chat

I need some ideas on how to use the publish/subscribe API to add in-app chatting/messaging capability.

Hi @Nkekere_Tommy_Minimann !

You can implement it using listeners ofr “add” event with conditions.
You can store your messages in a Database table with would also have channel identifier. Then you can subscribe for “add” event for this table with condition wich would resctrict selection by channel.
For more information about listeners I would recommend you to read our documentation Overview - Backendless SDK for JavaScript API Documentation

Regards, Andriy

Are you saying I should use the Real time database API instead of the pub/sub API?

@Nkekere_Tommy_Minimann ,

Sorry, my mistake. You should use Real-time Messaging service (Overview - Backendless SDK for JavaScript API Documentation) to accomplish your goal. You can do it in two ways: by creating for each conversation separate channel or by using conditional messages retrieval. First variant would be more secure since client would not be able easily intercept messages from others chats.

I would recommend you to try both variants and then decide which one would suite you better.

Regards, Andriy