Click here to Skip to main content
11,584,556 members (64,746 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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, '&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:

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 13-Jan-13 10:42am
r2jf296

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 430
1 Sergey Alexandrovich Kryukov 367
2 Dave Kreskowiak 260
3 Richard Deeming 220
4 virusstorm 194
0 OriginalGriff 1,703
1 Sergey Alexandrovich Kryukov 1,267
2 Abhinav S 711
3 Dave Kreskowiak 687
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web04 | 2.8.150707.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100