如何在 Windows Universal App 10 中实现推送通知?

How to Implement PUSH NOTIFICATION in Windows Universal App 10?

这可能是一个重复的问题。但是我还没有找到任何解决方案。您能否提供在 uwp 10 上注册推送通知应用程序的任何示例或示例代码?

需要客户端代码,推送通知类型是服务器到客户端。客户端应注册接收服务器推送并处理来自服务器的推送。

这是 localpush 的 link:http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/10/05/sending-a-local-tile-notification-in-windows-10.aspx

要从服务器推送通知,请阅读此处https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-windows-push-notification-services--wns--overview

我已经实现了推送通知。所以,它可能会帮助某人。 在App.xaml.cs中添加一个新方法:

private async Task InitNotificationsAsync()
{            
    // Get a channel URI from WNS.
    var channel = await PushNotificationChannelManager
                .CreatePushNotificationChannelForApplicationAsync();            
    channel.PushNotificationReceived += Channel_PushNotificationReceived;            
}

OnLaunched 方法中调用此方法:

protected async override void OnLaunched(LaunchActivatedEventArgs e)
{
     await InitNotificationsAsync();
     ...
}

希望这会有所帮助。