WinForms / WPF 应用程序的通知

Notifications for WinForms / WPF application

我有一个 Windows Forms 客户端应用程序。

该应用程序使用内置的 WebBrowser 显示 ASP.NET 核心本地托管站点。客户端没有持久的 Internet 连接(有时可用,有时不可用)。

现在我希望能够从 BackOffice 向此应用程序的用户发送通知。所以我有两种方法:

  1. 向 ASP 核心项目发送通知。本项目将转让 通知 JavaScript.

  2. 直接将通知发送至 UI JavaScript。

我想为此目的使用 Azure Norification Hub,但看起来我无法在 Forms 应用程序中使用它。经过一番调查后,我发现无法使用通知中心处理 Forms 应用程序中的推送通知。通知中心示例仅使用 UWP 应用程序进行 windows 通知 + 根据此 conversation 我无法实现目标。

所以我的第一个问题 - 有没有办法可以使用通知中心向 WinForms 应用程序发送推送通知?

通知中心使用 Google Firebase 云消息 (FCM) 向 Android 设备发送推送通知。 FCM 有 JavaScript notifications。所以我在考虑使用 Firebase 通过 Azure 通知中心发送通知。

我的第二个问题 - 是否可以使用 Azure 通知中心发送通知,将通知传递给 Firebase 并在 JavaScript 中捕获通知?

我的第三个问题 - 你能告诉我可以用来获取 WinForms 应用程序通知的其他方法吗?

is there a way I can use the Notification hub to send push notifications to a WinForms application?

无法为此使用 Azure 通知中心 purpose.Azure 通知中心不直接与设备一起工作,而是通过每个平台的平台通知服务进行通信。

Azure 通知支持 Apple(APNS),Google(GCM),Window(WNS),Windows Phone (MPNS), Amazon (ADM),百度(Android中国)。

如果我们想使用 Windows 通知服务,我们需要一个 将我们的应用关联到 Windows Store 并配置我们的通知中心以与 WNS 集成。 但是现在 Windows 商店不支持 Windows Form /WPF。所以我们不能使用通知中心向 WinForm 应用程序发送推送通知。

is it possible to send notifications using Azure Notification Hub, pass notifications to Firebase and catch notifications in JavaScript?

据我了解,没有。我们需要使用 Android SDK 来获取设备注册令牌,但您使用的是 winform 项目

could you please tell me other approaches I can use to get notifications for a WinForms application?

您可能需要使用socket来实现定制。