[Chat] Empty users list

[Chat] Empty users list

  
Forge Component
(29)
Published on 2015-11-24 by Hélio Dolores
29 votes
Published on 2015-11-24 by Hélio Dolores
Hi,
I'm really like your chat and would like to use it in my projects. But have sme problems to get it working.
I've installed Chat app on personal environment and setup heroku server. I've enabled chat and added  to all users. But when I load chat page (/chat/Mobile.aspx) I see screen with header with blank contacts list and messages in console:
Chat started
ConditionalStartClient.js:640session key: c4279373-12b4-a05c-834b-017c048f78b4
ConditionalStartClient.js:641user key: 666d9979-32be-4b2d-5271-d267d996bfca

None of users are displayed in offline or online lists.

However if I access in browser /chat/Mobile.aspx page it displays users correctly, but styles are missing. 
On Backoffice page inline chat is displayed all the time whether the "Show chat in all apps" is on or off.

I want to add to my app a screen with chat and do not have inline chat.

Can you suggest any possible solution?
Thank you very much.
 
Hi Mykola,

The chat windows should appear inline inside any other application, so you should open any application you have with the same user provider module (Users). The Mobile.aspx endpoint should be just a Phone page (a phone chat application). 

As an example, I have this Social application (http://heliodolores.outsystemscloud.com/Social) that will show a Chat window. 

If you want to build a screen with a (non-inline) chat, I'm sorry but unfortunatelly you have to implement it bacause I don't have a ready-to-use API for that.

If you want to use this component as a base, you'll need to:
- remove the chat injection from all applications (that's why you see those things on the mobile.aspx)
- use the webblock API in the page you want (you have a webblock to start the chat in a particular screen - you can reference it in the Chat module)
- change the client.js to render the mobile the view (I have an extension call to verify if the device is mobile to switch the rendered view - yes it is 100% rendered in Javascript)
- rebuild the mobile view for you scenario (In javascript)

If you have any questions feel free to ask.

best regards,
Helio








Thank you for quick reply, Helio.

So if I want to have only mobile chat (my app is mobile only) screen and no inline part I have to set chat to "Disabled" mode on backoffice, right?
I have set Mobile screen from chat app as Public and add it to my app. I've accesed the Mobile chat screen from mobile - it rendered interface but no contacts. 
Hi Mykola,

I'm sorry for the not-so-quick reply this time.

Yes, that's right, by disabling the chat in that button you are simply not injecting the scripts on every application.
By referencing the Mobile page from the Chat espace you should also be able to see the contacts as you expected.

So.. can you please see if you have any errors on the javascript console? Can you share those with me? 

Thanks,
Hélio



Hi Hélio,
Seems like all working now ) thanks for clarifications.
I will continue to update script to my needs. Are there any kind of documentation of how the script is working? I'm trying to figure out how script is connected to entities in app? 
For example if I want to get a user status status (online/offline) from my app I should create a function on a server or there is already somy sync process and I can get it from Chat_UserSessions for example?

Thank you.
Nick
Hi Mykola,

Unfortunately there's no documentation for this component. 

This component was build before the platform had the expose REST APIs, so I'm exposing a lot of screens that work as REST endpoints.
So.. the Server.js communicates this way with the Chat Web App to read and write the information from the database entities. 

This will all be re-done in the future.

I can share with you the Visual Studio solution where I generate the javascript for both Client and Server. 
It is all in Typescript and I make the mapping between the OutSystems structures and the JSON objects.

It can be changed by using the free VS for web apps.

Does it help?

regards,
Hélio


Hi Hélio,

Sharing VS solution would be great! Thank you.

Best,
Nick
Hi Mykola,

I'm sending the VS solution in attachment.

I really don't know if it is ready to be compiled, but it might need some tunning. 
I've removed some files (.css mostly) because you already have them in the .oml file.

hope it helps!

best regards,
Hélio
Thank you Hélio.