如何设置azure移动服务提供定期更新到windows 8(商店)应用程序

how to set up azure mobile service to deliver periodic updates to a windows 8 (store) App?

本文关键字:windows 定期更新 应用程序 商店 服务 何设置 设置 azure 移动      更新时间:2023-09-26

我想添加定期瓷砖更新到我的windows商店应用程序,一切工作正常,如果我提供一个xml到tileUpdateManager,例如这个地址http://wowzappelsalvador.azurewebsites.net/tiletest.xml。该应用程序与azure移动服务一起工作,我们的想法是使用相同的服务更新应用程序贴片,所以我在azure上创建了一个读取脚本,如下所示:

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, '&lt;')
           .replace(/>/g, '&gt;')
           .replace(/"/g, '&quot;');
        }
         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文件和tile更新不起作用,我错过了什么?

注意:我已经看到一些网站解释如何在azure移动服务上使用push.wns.send来发送推送或toast通知,但我的案例是一个轮询通知,客户端代码如下:

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);

任何帮助将非常感激!

目前,Azure移动服务没有返回JSON以外的任何内容的能力。这是一个反复出现的请求,所以这个功能在路线图中,应该在不久的将来实现。