locked
Windows 8. Push notifications using JavaScript RRS feed

  • Question

  • Can you help me with example application?

    Because here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465450.aspx

    Friday, November 16, 2012 3:02 PM

Answers

  • Push notifications are typically sent from a web service, not an app itself. The responsibility of an app is to request a WNS channel URI and pass that URI to a service. When the service then detects that it needs to issue a push notification through WNS, it does so by posting a request to that channel URI with the necessary data. This happens independently of the app, as one of the primary purposes of push notifications is to have new information arrive on a user's device when the app itself isn't running.

    The topic that you refer to, even when it speaks of C#,etc. (see http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh868252(v=win.10).aspx), is referring to the implementation of the web service not an app implementation. (The key reason for this is that if your app is running, you can issue a tile/toast update directly without having to go through WNS, which would just inefficient.) You typically don't write a web service in JavaScript, but rather use technologies like PHP or ASP.NET; that's why the page you refer to doesn't give much guidance.

    For a full treatment of this subject including the service side of the story, see Chapter 13 of my free ebook, Programming Windows 8 Apps with HTML, CSS, and JavaScript. That will help make sense of this whole subject and the companion content provides sample web services that can interact with the Windows SDK client-side samples.

    .Kraig

    Saturday, November 17, 2012 7:47 PM

All replies

  • Push notifications are typically sent from a web service, not an app itself. The responsibility of an app is to request a WNS channel URI and pass that URI to a service. When the service then detects that it needs to issue a push notification through WNS, it does so by posting a request to that channel URI with the necessary data. This happens independently of the app, as one of the primary purposes of push notifications is to have new information arrive on a user's device when the app itself isn't running.

    The topic that you refer to, even when it speaks of C#,etc. (see http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh868252(v=win.10).aspx), is referring to the implementation of the web service not an app implementation. (The key reason for this is that if your app is running, you can issue a tile/toast update directly without having to go through WNS, which would just inefficient.) You typically don't write a web service in JavaScript, but rather use technologies like PHP or ASP.NET; that's why the page you refer to doesn't give much guidance.

    For a full treatment of this subject including the service side of the story, see Chapter 13 of my free ebook, Programming Windows 8 Apps with HTML, CSS, and JavaScript. That will help make sense of this whole subject and the companion content provides sample web services that can interact with the Windows SDK client-side samples.

    .Kraig

    Saturday, November 17, 2012 7:47 PM
  • Thank you, Kraig!

    I created my server-side, using PHP

    Wednesday, November 21, 2012 9:15 AM