Unanswered Windows 8 Live Tile Update Scheduled

  • Monday, August 06, 2012 2:21 PM
     
     
    I would like to create a scheduled live tile update to update a tile whether the app is running or not.  I would like the schedule to update every 24 hours.  The data for the update is being stored locally within the app.  how do I schedule this type of updated live tile?  As part of this, I would like to create up to 5 different display messages in the tile notification queue.  All of them will be updated every 24 hours based on the local data.

All Replies

  • Monday, August 06, 2012 11:36 PM
    Moderator
     
     

    Hi Paul,

    This is demonstrated for Tiles in the Scheduled notifications sample

    See Quickstart: Sending a tile update for background information on how to send an unscheduled tile update. Take a look at How to schedule a toast notification for a general overview of how scheduled notifications work. Tiles are scheduled similarly, but the documentation for that isn't ready yet.

    If you still have questions please let us know more specifically where you are confused.

    --Rob

     

  • Tuesday, August 07, 2012 12:40 AM
     
     

    Rob,

    Thank you for the response.  The thing I'm trying to figure out is this.  The ScheduledTileNotification does not include a third parameter into the constructor to set a schedule for updating the tile recurring like the ScheduledToastNotification.  How do I set this up to be recurring?

    // Create the notification object.
    var futureTile = new Notifications.ScheduledTileNotification(tileXml, dueTime);

  • Thursday, August 09, 2012 9:46 AM
     
      Has Code

    Hi Paul,

    Will you consider using TileNotification.ExpirationTime to manage the tiles display? See if the following code helps you:

      XmlDocument tileXML_1 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImageAndText01);
                XmlNodeList tileTextAttribute = tileXML_1.GetElementsByTagName("text");
                tileTextAttribute[0].AppendChild(tileXML_1.CreateTextNode("This tile notification uses ms-resource images"));
                XmlNodeList tileImageAttributes = tileXML_1.GetElementsByTagName("image");
                ((XmlElement)tileImageAttributes[0]).SetAttribute("src", "ms-resource:TileImages/20110213114606270.jpg");
                XmlDocument tileXML_2 = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImageAndText01);
                XmlNodeList tileTextAttribute_2 = tileXML_2.GetElementsByTagName("text");
                tileTextAttribute_2[0].AppendChild(tileXML_2.CreateTextNode("This tile notification uses ms-resource images------2")); 
                XmlNodeList tileImageAttributes_2 = tileXML_2.GetElementsByTagName("image");
                ((XmlElement)tileImageAttributes_2[0]).SetAttribute("src", "ms-resource:TileImages/1_110706120126_5.jpg");
                NotificationSetting setting = TileUpdateManager.CreateTileUpdaterForApplication().Setting;
               TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
                TileNotification tileNotification = new TileNotification(tileXML_1);
                tileNotification.Tag = "Wide Tile 1";
                TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
                TileNotification tileNotification_2 = new TileNotification(tileXML_2);
                tileNotification.Tag = "Wide Tile 2";
                Windows.Globalization.Calendar cal = new Windows.Globalization.Calendar();
                cal.SetToNow();
                cal.AddSeconds(10);
                tileNotification.ExpirationTime = cal.GetDateTime();
                TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification_2);