How to Implement PUSH NOTIFICATION in Windows Universal App 10?

This may be a duplicate question. But I did not find any solution yet. Can you please provide any example or sample code for registering App for PUSH NOTIFICATION on uwp 10?

Client code needed and Push notification type is Server to client. Client should register for receiving Server PUSH and Handle the push coming from server.

Answers


Here is the link for localpush: http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/10/05/sending-a-local-tile-notification-in-windows-10.aspx

For push notification from server to work, read here https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-windows-push-notification-services--wns--overview


I have implemented push notification. So, It may help someone. Add a new method in App.xaml.cs:

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

Call this method inside OnLaunched method:

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

Hope this will help.


Need Your Help

Google Closure Compiler: default CompilerOptions

javascript obfuscation google-closure-compiler

In the source code, the Class CompilerOptions is used to control the compilation process. We can manually configure the options by calling "setXXX()" methods, such as "foldConstants" and "removeDea...

Threaded network listener with return values

c# multithreading sockets network-programming

I'm currently trying to accomplish a project, which listens multiple ports and recieves incoming data.