Website notifications

Thread is closed for posting
2 posts, 0 answers
  1. Mark
    Mark avatar
    11 posts
    Member since:
    Oct 2015

    Posted 05 May 2016 Link to this post

    I have a web app that has native mobile versions. the app involves messaging that has been implemented. I can send and receive the messages no problem and the notifications are working on android. But i need to be able to notify the web user when a new message is there to be read. The back-end services is provided by Telerik and there are javascript functions fired when there is new content. the web app is built primary in javascript as well. how do i pass a message from the JS running on the back-end and the front-end web app.
  2. Anton Dobrev
    Anton Dobrev avatar
    609 posts

    Posted 10 May 2016 Link to this post

    Hello Mark,

    The easiest way is to ping on regular intervals or in a significant event of the web app (when the user logs in, for example, or navigates to a view) and read the content type in Backend Services with a filter for new messages for this user.

    At the current stage, the backend cannot notify remotely a web app that something interesting happened on the server. We have a feature request with the same subject here where you can share your ideas or considerations. We also have further ideas in mind for similar features and your feedback is important for us. Thanks in advance.

    Alternatively, you may consider the following approach using an external provider that offers real-time/web notifications services and has client JavaScript SDK support (for the web app) and a REST API (for the server integration).

    For example:

    - Subscribe the web app with JavaScript for this service and the respective events
    - In the afterCreate event of the cloud code, when a new message is added, contact the external service with an HTTP request that it has to accept a new event and to notify the subscribers
    - In the web app, the JavaScript SDK of this service will detect that it has new messages for it

    I hope that this answers your question.

    Anton Dobrev
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
Back to Top