This is a migrated thread and some comments may be shown as answers.

Website notifications

1 Answer 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark
Top achievements
Rank 1
Mark asked on 05 May 2016, 10:55 AM
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.

1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 10 May 2016, 11:31 AM
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.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or