locked
Live tiles not working

    Question

  • Hello, i can't get my tiles to work... what's wrong?

             var app = WinJS.Application;
        var activation = Windows.ApplicationModel.Activation;
    
        var notifications = Windows.UI.Notifications;
    
        var template = notifications.TileTemplateType.tileWidePeekImage01; // Didžioji
        var tileXml = notifications.TileUpdateManager.getTemplateContent(template);
        var tileTextAttributes = tileXml.getElementsByTagName("text");
        var tileImageAttributes = tileXml.getElementsByTagName("image");
    
        var squareTemplate = notifications.TileTemplateType.tileSquareText02; // Mažoji
        var squareTileXml = notifications.TileUpdateManager.getTemplateContent(squareTemplate);
        var squareTileTextAttributes = squareTileXml.getElementsByTagName("text");
       tileTextAttributes[0].appendChild(tileXml.createTextNode("Ar žinojai?"));
            tileTextAttributes[1].appendChild(tileXml.createTextNode("Nk"));
    
            tileImageAttributes[0].setAttribute("src", "ms-appx:///images/livetile.png");
    
            var node = tileXml.importNode(squareTileXml.getElementsByTagName("binding").item(0), true);
            tileXml.getElementsByTagName("visual").item(0).appendChild(node);
    
            // Bendri reikalai
            var tileNotification = new notifications.TileNotification(tileXml);
            var currentTime = new Date();
            tileNotification.expirationTime = new Date(currentTime.getTime() + 60000); // tile'as laikysis 8h (laiką pridėti milisekundėm)
            notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);

    Nothing happens when i run(but when i click on the app it shows that i can turn off Live tiles).. Please help. Thank you.

    Sunday, June 16, 2013 11:21 AM

All replies