0

In my application i want to schedule a local notification for a particular time.

This local notification need to send when the app is closed too. (back ground Task )

I am using win RT, not silver light.

Thank you in advance.

Pavan Reddy
  • 173
  • 1
  • 3
  • 11
  • Background task evoked every 30 minutes or so on a timer. You can try this. That good enough for your needs? – kernanb Feb 07 '16 at 21:58

1 Answers1

0

you have yo use ScheduledToastNotification

The following example shows a toast notification scheduled to display in one hour.

var Notifications = Windows.UI.Notifications;
var currentTime = new Date();
var seconds = 60;
var dueTime = new Date(currentTime.getTime() + seconds * 60 * 1000);
var idNumber = Math.floor(Math.random() * 100000000);  // Generates a unique ID number for the notification.

// Set up the notification text.
var toastXml = Notifications.ToastNotificationManager.getTemplateContent(Notifications.ToastTemplateType.toastText02);
var strings = toastXml.getElementsByTagName("text");
strings[0].appendChild(toastXml.createTextNode(This is a scheduled toast notification));
strings[1].appendChild(toastXml.createTextNode("Received: " + dueTime.toLocaleTimeString()));

// Create the toast notification object.
var toast = new Notifications.ScheduledToastNotification(toastXml, dueTime);
toast.id = "Toast" + idNumber;

// Add to the schedule.
Notifications.ToastNotificationManager.createToastNotifier().addToSchedule(toast);

you have to work with dueTime and toast id

Kushal Maniyar
  • 846
  • 1
  • 8
  • 26