Notifications & Metro Style apps in Windows8 : Local Toast
As explained in the previous post about notifications in Windows8, notifications can be local or from the Cloud ( push ) .
In this post, we will be discussing the local notifications.
Start a new project
Define the notification
You should first choose a template for your toast, you can refer to Toast Template Type.
Back to the toast.js where we will write the following code :
“This example uses the ToastImageAndText01 template, which consists of a large image with, to its right, a single string wrapped across three lines of text.
To specify the content, we retrieve the collection of text elements then enumerates through that collection, assigning a string to each of those elements . It then retrieves the image element and assigns it an image and alt text.” Windows dev center – Metro Style apps
See the toast in action
We need to let the application send the toast.
In the ‘ default.html’ file, add a reference to the toast script :
Voila ! Quick and easy