Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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:

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


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:

C#
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!
Posted

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900