Search code examples
windows-phone-8.1live-tilebackground-task

Update LiveTile from Background Task WP8.1


I cannot update manually pinned tile from Background Task.

var updater = TileUpdateManager.CreateTileUpdaterForApplication();
updater.EnableNotificationQueue(true);
updater.Clear();

XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText03);

var title = "Test text";
string titleText = title == null ? String.Empty : title;
tileXml.GetElementsByTagName("text")[0].InnerText = titleText;

updater.Update(new TileNotification(tileXml));

Exception fires on CreateTileUpdaterForApplication(); with message: The application identifier provided is invalid.

I heard what this problem occurs on Windows Phone with 8.1 update, but I not found any solutions... Please help.


Solution

  • I was having exactly the same issue. After three hours of research (damn waste of time :/) I found the solution:

    var updater = TileUpdateManager.CreateTileUpdaterForApplication("App");
    

    Thanks to the guy who posted that (http://social.msdn.microsoft.com/Forums/windowsapps/en-US/83498107-fe0d-4a8b-93f3-02d484983953/tileupdatemanager-throws-exception?forum=wpdevelop)! Cannot believe that I did not see the "(+1 overload(s))" when hovering the mouse over the call -.-