ArrowDB - how to get event listener of a chat sent to group?

29 views Asked by At

I'm developing a real time chat app using Titanium Appcelerator. I have everything working with ArrowDB and one user can send another user a message through a group.

https://docs.appcelerator.com/arrowdb/latest/#!/api/Chats

However there doesn't seem to be a method or listener to identify when a new message has been sent to the group.

What I'd like to see is when the other user is typing, and as soon as the message is sent it bubbles up on the recipients chat window. Exactly like how iMessage works.

The only way I can pull new messages from the group to the local users device is to have a refresh button or to use a setInterval with a function call to refresh the messages.

obviously this is not a great way to handle the situation as with a few hundred users every month this would make for hundreds of thousands of api calls and probably not good for device performance.

Does anyone have any ideas how to get real time chat working? Is there a method or event listener I am missing that isn't document?

Push notifications only work while the app is in the background, so this is not an option unfortunately.

0

There are 0 answers