如何设置azure移动服务以定期更新到Windows 8(商店)应用程序? [英] how to set up azure mobile service to deliver periodic updates to a windows 8 (store) App?
问题描述
我想在我的Windows商店应用程序中添加定期磁贴更新,如果我向tileUpdateManager提供xml,一切正常,例如此地址 http://wowzappelsalvador.azurewebsites.net/tiletest.xml [ ^ ]。
该应用程序适用于天蓝色移动服务,其目的是使用相同的服务更新应用程序磁贴,因此我在azure上创建了一个读取脚本,如下所示:
I want to add periodic tile updates to my windows store App, everything works ok if I provide a xml to the tileUpdateManager like for example this address http://wowzappelsalvador.azurewebsites.net/tiletest.xml[^].
The app works with an azure mobile service and the idea is to have the App tile updated using the same service so I created a read script on azure like this:
function read(query, user, request) {
mssql.query("select imagenTile, nombreTip from verdetips.tipDiaLiveTileView", {
success: function(results) {
var xmlEscape = function (text) {
return text.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
var payload = "<?xml version='1.0' encoding='UTF-8'?>" +
"<tile><visual><binding template='TileWideImageAndText01'>" +
"<image id='1' src='" + xmlEscape(results[0].imagenTile) + "' alt='Verde Tips'/>" +
"<text id='1'>" + xmlEscape(results[0].nombreTip) + "</text>" +
"</binding>" +
"<binding template='TileSquareText04'>" +
"<text id='1'>" + xmlEscape(results[0].nombreTip) + "</text>" +
"</binding></visual></tile>";
console.log(payload);
request.respond(statusCodes.OK, payload);
}
});
}
当我调用与此脚本相关联的表时,我得到与.xml文件相同的文本但是在一个.json文件和磁贴更新不起作用,我缺少什么?
注意:我看过一些网站解释如何使用推送。 wns.send在azure移动服务上发送推送或Toast通知,但我的情况是轮询通知,客户端代码如下:
when I call the table associated with this script I get the same text as on the .xml file but on a .json file and the tile update doesn''t work, what am I missing?
Note: I''ve seen some sites explaining how to use push.wns.send on azure mobile services to send push or toast notifications but my case is a polled notification, client code as follows:
var notifications = Windows.UI.Notifications;
var polledUri = new Windows.Foundation.Uri("http://verdetips.azure-mobile.net/tables/tipDiaLiveTile");
//var polledUri = new Windows.Foundation.Uri("http://wowzappelsalvador.azurewebsites.net/tiletest.xml");
var recurrence = notifications.PeriodicUpdateRecurrence.daily;
var tileUpdater = notifications.TileUpdateManager.createTileUpdaterForApplication();
tileUpdater.startPeriodicUpdate(polledUri, recurrence);
我们非常感谢任何帮助!
Any help would be much appreciated!
推荐答案
这是Azure移动服务和Windows 8商店的快速背景应用程序。
http://devhammer.net/blog/building-back-end-data-and-services-for-windows-8-apps-adding-推送通知 [ ^ ]
希望有所帮助。
谢谢,
Frank
// Frank La Vigne /美国公共部门开发者布道者< br $>
// 30启动注册http://bitly.com/30ToLaunchWin8
// @ tableteer / http://www.FranksWorld.com
Hi,
Here''s a quick backgrounder on Azure Mobile Services and Windows 8 Store apps.
http://devhammer.net/blog/building-back-end-data-and-services-for-windows-8-apps-adding-push-notifications[^]
Hope that helps.
Thanks,
Frank
// Frank La Vigne / US Public Sector Developer Evangelist
// 30 To Launch Sign up at http://bitly.com/30ToLaunchWin8
// @tableteer / http://www.FranksWorld.com
这篇关于如何设置azure移动服务以定期更新到Windows 8(商店)应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!