locked
TileNotification with image from temporary folder is ignored

    Question

  • Hi,

    I'm trying to create a TileNotification using a temporary image, something like this:

    var Notifications = Windows.UI.Notifications;
    var tileUpdater = Notifications.TileUpdateManager.createTileUpdaterForApplication();
    tileUpdater.enableNotificationQueue(true);
    var tileXml = Notifications.TileUpdateManager.getTemplateContent(
        Notifications.TileTemplateType.tileWideImage);
    var tileImageAttributes = tileXml.getElementsByTagName("image");
    tileImageAttributes[0].setAttribute("src", "ms-appdata:///temp/"+filename);
    tileImageAttributes[0].setAttribute("alt", filename);
    var tileNotification = new Notifications.TileNotification(tileXml);
    tileUpdater.update(tileNotification);

    But it does not work, no exceptions.

    If I use ms-appdata:///local/ instead it works without problems. Any idea?

    Thanks!

    Juanma


    Juan Manuel Servera
    twitter: @jmservera
    mi blog: http://jmservera.wordpress.com
    Únete al grupo de WP7 en LinkedIn
    MCPD WP7 Developer - MCTS Sharepoint 2010 Application Development


    Tuesday, May 29, 2012 10:47 AM

All replies

  • The temp folder may be getting cleared?  You can use process monitor to see what file activity is occuring when it tries to read this folder.

    http://technet.microsoft.com/en-us/sysinternals/bb896645

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, May 29, 2012 1:51 PM
    Moderator
  • Thanks for your answer. I've checked it with Process Explorer and the file it is not deleted. In fact I can open the temp folder and see all the created files there.

    The only different thing I see when using temp folder instead the local one is that explorer.exe tries in one place to create the file in:

    C:\Users\jservera\Documents\Visual Studio 11\Projects\msCanvasTest\PaintJS\bin\Debug\AppX\ms-appdata:\temp\test (2).png

    Instead of in the folder that is finally created (TempState)

    C:\Users\jservera\AppData\Local\Packages\114e256f-bf10-4878-8e41-cf4f7e5f9818_kp7yavnxmsawr\TempState\test (2).png

    Maybe a bug or unsupported feature in TileNotifications?

    Thanks,

    Juanma


    Juan Manuel Servera
    twitter: @jmservera
    mi blog: http://jmservera.wordpress.com
    Únete al grupo de WP7 en LinkedIn
    MCPD WP7 Developer - MCTS Sharepoint 2010 Application Development

    Tuesday, May 29, 2012 3:05 PM
  • Interesting, how about when the file is read?  What do you see different between the local and temp examples?

    Jeff Sanders (MSFT)

    Tuesday, May 29, 2012 3:29 PM
    Moderator