make push notification service with signalr

心不动则不痛 提交于 2019-12-11 11:58:37

问题


Hi can I make push notification service with signalR? for example when user start the app,app can recive message and if app closed again app can recive messgae from servers or clients


回答1:


Until you can send the message to clients that user is online.

And with the closure of the app, Disconnect Communication server with the client. And the ability to send any message disappears.

If you want to send notification after app closed, It is better to use the google service. (e.g: Firebase Cloud Messaging (FCM) services), Otherwise you can only use signalR for send message in your app.

I hope this is useful description.




回答2:


If you want the ability to send messages or have messages available to any client then store them in a database table. When they are connected, you can send those messages to them. When they are disconnected they would stay in the database.

You can control flagging messages as read after they are delivered and then deleting them from the database.

Your "push notification" is just querying for the messages when a client is connected.



来源:https://stackoverflow.com/questions/55826033/make-push-notification-service-with-signalr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!