Adding group channel to the project

Dear Community,

Is there any step-by-step instruction on how to add group channel (chat) to Epicenter.js? I already checked the documentation (https://forio.com/epicenter/docs/public/rest_apis/multiplayer/channel/#epijs-example) and it contains complete example. However, there is no explanation as to where it needs to be added. Is it inside “pages” folder or on the root folder of Interface or elsewhere?

Thank you.

Hi,

Unfortunately, there’s no easy way of include chat in simulations solely built with the interface builder.

We do however support multiplayer chat in Forio Epicenter as whole. You will need to implement this with JavaScript programming.

The two features that Forio provides which can be used to support online chat

  • The Data API, which is a general purpose way of storing JSON fragments. You can store each chat message in a group-scoped collection of messages.
  • The Push Channel, which enables your code to automatically be notified when new document is added to a data api collection, allowing the page to immediately display the message.

Documentation links here
https://forio.com/epicenter/docs/public/api_adapters/generated/data-api-service/
and
https://forio.com/epicenter/docs/public/api_adapters/generated/channels/epicenter-channel-manager/

I don’t have a specific code sample, but can describe in general terms the three parts you would need to code:

a) sending mesages – when text is entered, add the text (with fields for sender and receiver) as a document in the data api.

b) displaying messages when page is loaded-- have a text box showing chat messages that (when the page is loaded) automatically shows all messages from data api collection.

c) dynamically updating message list – use the push channel (the link you included) to listen for updates to the data api collection. When a new document is added, automatically show it in the list.

Hope this provides some insight. Eventually we will add something more turnkey to the interface builder. (which is likely more what you want).

Best, WILL

1 Like