0

Im trying to send some notifications to a windows store app, from a node.js api. My objective is to have a couple of notifications, that have an animation where one is being displayed , then the other would slide up and stayed for 5 secs or so, then it would go down again showing the first notification, this in a loop

Im using this to send notifications to my app

    var wns = require('push-notify').wns({
        client_id: 'ClientID',
        client_secret: 'ClientSecret'
    });

// Send notification.

    wns.send({
        channelURI: 'URI',
        payload: '<tile >'+
        '<visual version="3" addImageQuery="true">'
        + '<binding template="TileSquare71x71Image">'
        + '<image id="1" src="http://static.wintech.pt/win8_tile310x150.png" alt="Web image"/>'
        + '</binding>'
        + '<binding template="TileSquare150x150Image" fallback="TileSquareImage">'
        + '<image id="1" src="http://static.wintech.pt/win8_tile310x150.png" alt="Web image"/>'
        + '</binding>'
        + '<binding template="TileWide310x150ImageAndText01" fallback="TileWideImageAndText01">'
        + '<image id="1" src="http://static.wintech.pt/win8_tile310x150.png" alt="Web image"/>'
        + '<text id="1">This tile notification uses web images.</text>'
        + '</binding>'
        + '<binding template="TileSquare310x310Image">'
        + '<image id="1" src="http://static.wintech.pt/win8_tile310x150.png" alt="Web image"/>'
        + '</binding>'+
        '</visual>'+
        '</tile>',
        type: 'tile'
    });


    console.log("after1");

    setTimeout(function() {

        console.log("5 secs");
        wns.send({
            channelURI: 'URI',
            payload: '<tile >'+
            '<visual version="4" addImageQuery="true">'
            + '<binding template="TileSquare71x71Image">'
            + '<image id="1" src="http://archiecomics.com/wp-content/uploads/2014/08/ArchieWindowsStoreTile_310x150.png" alt="Web image"/>'
            + '</binding>'
            + '<binding template="TileSquare150x150Image" fallback="TileSquareImage">'
            + '<image id="1" src="http://archiecomics.com/wp-content/uploads/2014/08/ArchieWindowsStoreTile_310x150.png" alt="Web image"/>'
            + '</binding>'
            + '<binding template="TileWide310x150ImageAndText01" fallback="TileWideImageAndText01">'
            + '<image id="1" src="http://archiecomics.com/wp-content/uploads/2014/08/ArchieWindowsStoreTile_310x150.png" alt="Web image"/>'
            + '<text id="1">This tile notification uses web images.</text>'
            + '</binding>'
            + '<binding template="TileSquare310x310Image">'
            + '<image id="1" src="http://archiecomics.com/wp-content/uploads/2014/08/ArchieWindowsStoreTile_310x150.png" alt="Web image"/>'
            + '</binding>'+
            '</visual>'+
            '</tile>',
            type: 'tile'
        });
    }, 5000);

But apparently all this does is show the first notification for 5 secs then tile rotates and shows second.

Is there any way of defining a loop between those 2 in xaml?

Thought
  • 5,326
  • 7
  • 33
  • 69

1 Answers1

0

You cannot define custom animations for the tiles. The list of available tile types are listed here:

The tile template catalog (Windows Runtime apps)

Based on your code I'm not sure if you're using Notifications. If not, you may find them useful:

Using the notification queue (Windows Runtime apps)

Use of the notification queue allows a tile to display a rotation of up to five notifications. By default, a tile on the Start screen displays the content of a single notification until a new notification replaces the current notification. With notification queuing enabled, up to five notifications are maintained in the queue and the tile cycles through them.

But please note that you still cannot define how these are animated or looped:

The amount of time each notification in the queue is displayed and the order in which they appear on the tile is based on several internal factors and cannot be controlled by apps.

Mikael Koskinen
  • 12,306
  • 5
  • 48
  • 63