Search Unity

UWP Live Tile Support

Discussion in 'Windows' started by Darkays, Sep 28, 2019.

  1. Darkays

    Darkays

    Joined:
    Mar 31, 2013
    Posts:
    176
    Hello!

    I have a bit of a long shot question to ask but I figured, "Why not try?"

    I have been looking into adding Live Tile support in my game and have been messing around with the built in Unity solution through the UnityEngine.WSA.Tile class. This has worked pretty well so far! Currently, I have support for sending tile notifications using the Tile.Update(xml) function. Even going as far as using the predefined Live Tile templates of the older Windows 8/8.1 to make it look just right. But there are a couple of things that I want to add support for that I'm not entirely sure how to go about finishing.

    First, I want to try and add support for changing the image of the Live Tile to one of the assets from within the project. I have been using "ms-appx:///Assets/Square150x150Logo.png" as a way to put the default Live Tile image in. But I would love to be able to change this up by using a sprite or texture from within the Unity project. Is there a way to do this? I know that I could use something like texture.EncodeToPNG(), save the image into the app data and use "ms-appdata:///local/..." to gain access to it, but is there an easier way that doesn't require saving the image?

    The second thing I want to add in is support for multiple Live Tile notifications. For an example, one notification is "Total time played: 2hrs 49mins" and another one is "Campaign Progress: 35% complete" or something to that effect. This is so it shows you a collection of interesting information and encouraging you to pick up the game again (especially if you are close to beating an achievement!). I saw Microsoft.Toolkit.Uwp.Notifications and/or Windows.UI.Notifications have some support for queuing notifications up like this. I'm not sure how to add Microsoft.Toolkit.Uwp.Notifications because it is a NuGet package. Is there was a way to have NuGet packages compile within Unity. I also realize that I am currently using the older API and I might be able to use the newer Adaptive tiles?

    TL;DR:
    How do you add support for different Live Tile images from within a Unity Project?
    How do you add support for multiple Live Tile notifications?


    I know that this is niche of a niche, that approximately <1% of people will care about, but I was (heh still am) a diehard Windows Phone fan and always loved when apps/games used Live Tiles.

    Thanks for any suggestions and/or assistance!