且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何实现推送通知

更新时间:2023-02-16 22:07:31

请参阅解决方案此repo: GitHub - Harmen1969 / SignalR-Postgresql-:使用SignalR和PostgreSQL的实时推送通知 [ ^ ]


推送通知特定于您的Web开发框架。因为服务器维护一个开放端口,用于通知推送给客户端。在简单的Web界面上,ASP.NET SignalR就足够了,您可以使用JavaScript来处理新消息。



你需要的东西已经解决了(以一般方式)在这个链接上,你只需要在更改事件上触发消息。

教程:入门使用SignalR 2和MVC 5 | ASP.NET站点 [ ^ ]



但是,如果您的意思是原生移动通知,那么也是特定于设备的,例如Google Firebase for Android等。你需要单独的iOS,Windows Phone和Kindle等键。它们都有自己的实现和访问方法来通知。如果你知道怎么做,你可能会对它们感兴趣,

Firebase |应用程序的成功变得简单 [ ^ ]



Microsoft Azure允许您使用集线器启用跨设备推送通知。通过一个门户使用他们的密钥。

通知中心 - 移动推送通知| Microsoft Azure [ ^ ]

I need to implement push notification in my application, whenever a table gets updated by other user(updating some records through UI).

I have been googling from the morning, but I cant able to proceed further.

What I have tried:

I have found some recommendations to use sqlDependency class with SignalR if its SQL server, but I'm not using SQL server.

kindly suggest me, how to implement in my application

See for solution this repo: GitHub - Harmen1969/SignalR-Postgresql-: Real time push notification using SignalR and PostgreSQL[^]


Push notifications are specific to your web development framework. Because it is the server maintaining an open port for pushing the notification to client. On simple web interface, ASP.NET SignalR is enough and you can use JavaScript to handle new messages.

What you need is already solved (in a general way) on this following link, you just need to trigger the message on change event.
Tutorial: Getting Started with SignalR 2 and MVC 5 | The ASP.NET Site[^]

However if you mean native mobile notifications, then are also device specific, such as Google Firebase for Android etc. You would require separate keys for iOS, Windows Phone and Kindle etc. They all have their own implementations and access methods for notifications. You might be interested in them if you know how-to,
Firebase | App success made simple[^]

Microsoft Azure allows you to use a hub to enable push notifications cross-device. using their keys through one portal.
Notification Hubs - Mobile push notifications | Microsoft Azure[^]