我试图从 node.js api 向 Windows 商店应用程序发送一些通知。我的目标是有几个通知,有一个正在显示的动画,然后另一个会向上滑动并停留 5 秒左右,然后它会再次向下显示第一个通知,这是一个循环
我用它来向我的应用程序发送通知
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);
但显然这一切只是显示第一个通知 5 秒,然后瓷砖旋转并显示第二个。
有没有办法在 xaml 中定义这两个之间的循环?