Advertisment

Win Phone 7: Notification Services

author-image
CIOL Bureau
Updated On
New Update

BANGALORE, INDIA: One of the biggest things that are reportedly "missing" from the Windows Phone 7 device is the lack of multi-tasking. However, Microsoft has an answer to this. WP7 does not enable multitasking for 3rd party applications for a number of reasons. First off, running a single application at a time allows the app to use the full resources of the phone - unlike when multiple applications are running.

Advertisment

You must remember that a phone is not a desktop where multiple applications can run coolly with each other. The second reason is that a single application running drains the battery much less. And finally, some of the stuff that can be done through a multitasking set of applications can be done by using the Notification Services API available for the phone and through a set of MS services in the cloud.

publive-image

Notification Services

There are three things that can be done with the API in Windows Phone:

Advertisment

1. Send a notification directly to a running application from a custom application service you have written. This will go through the MS notification service to the phone. This is called a "Raw" notification.

2. Send a "Toast" notification to the phone. This pops out of the top of the phone like a SMS and stays visible for 10 seconds, even when the app is not running. Clicking the toast will immediately launch the application to which the toast was sent.

3. Change the "Live Tile" of an app that's pinned to the Start screen. This allows you to create tiles that update automatically and can show a bunch of different information.

Advertisment

To get any of the different types of notifications, there is a process that needs to be followed.

Step 1: The application on the phone registers a "Channel" with the MS notification service.

Step 2: The Notification Service (hosted on Windows Azure) sends back a unique URI for that channel which identifies the phone.

Step 3: The application binds the type of notification(s) it can/wishes to receive to this URI

Step 4: A custom service that you build can then call the service using the same channel and URI information

Step 5: The MS service will send the correct notification to the URI formatted according to the way it is expected.

Step 6: A Push Notification client on the phone gets the notification and creates the toast, tile or sends it to the app if running directly.

Click here to read more!

tech-news