How to schedule a tile notification (Windows Store apps using C#/VB/C++ and XAML)
This topic shows how to schedule a tile notification to appear at a specific time.
- Windows Runtime
- A working knowledge of tile and notification terms and concepts. For more information, see Tiles, Badges, and Notifications.
Windows.UI.Notifications includes the tile APIs.
Before you can specify the delivery time, you must create the notification.
Note When GetTemplateContent is called on a Windows 8 system, it returns a version 1 template. When this method is called on a Windows 8.1 system, it returns a version 2 template. However, if an app specifies Windows 8 compatibility in its manifest, this method returns a version 1 template regardless of the Windows version. In this topic, we'll use a version 2 template.
TileTemplateType tileTemplate = TileTemplateType.TileSquare150x150Text01; XmlDocument tileXml = TileUpdateManager.GetTemplateContent(tileTemplate);
We won't cover this here because it's the same for a scheduled notification as for a non-scheduled notification. For more information, see Quickstart: Sending a tile update.
This example specifies that the notification should appear in 3 hours. This example uses the DateTime object.
Send the tile notification content and the scheduled delivery time to the constructor.
This ID must be 16 characters or less.
Create the TileUpdater object, which in turn is used to add your notification to the schedule.