Kinjan Bhavsar

Kinjan Bhavsar

  • NA
  • 28
  • 2.1k

How to display push notification for user in windows 8.1?

Jul 8 2015 5:30 AM
I am currently working on Windows 8.1 Push Notification part. I have read different links and found that first we need to register the app and get all the information like SID and Client Secret and send to our server team so they can send push notification.

Then after this, I implemented the following code at my side to get channelUri and Expiration date of that Uri from WNS.

PushNotificationChannel channel = null;
try
{
channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
if (channel != null)
{
var notificationUri = channel.Uri;
var expiration_time = channel.ExpirationTime;
}
channel.PushNotificationReceived += channel_PushNotificationReceived;
}
catch (Exception ex)
{
if (ex != null)
{
System.Diagnostics.Debug.WriteLine(ex.HResult);
}
}

I have received all the values perfectly and my server team added a logic to send me push notification. Now, the problem which I am facing is that I am not aware how to display the received push notification sent by server to that user. Also, can we display the notification is the app is not running or is in background?


Answers (1)