2012-10-15 68 views

回答

1

,你把它提供給一個TileUpdater例如,你可以從文檔中看到下面TileUpdateManager。這個簡單的方案處理local notification(但也有scheduledperiodicpush通知您可以利用)。

查看App tiles and badgesPush and periodic notifications樣本以獲得指導。

function sendTileTextNotification() { 
    var Notifications = Windows.UI.Notifications; 

    // Get an XML DOM version of a specific template by using getTemplateContent. 
    var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText03); 

    // You will need to look at the template documentation to know how many text fields a particular template has. 
    // Get the text attribute for this template and fill it in. 
    var tileAttributes = tileXml.getElementsByTagName("text"); 
    tileAttributes[0].appendChild(tileXml.createTextNode("Hello World!")); 

    // Create the notification from the XML. 
    var tileNotification = new Notifications.TileNotification(tileXml); 

    // Send the notification to the calling app's tile. 
    Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification); 
}