What are MSN Alerts?
MSN Alerts Service is a part of Microsoft .NET My Services Initiative. It enables the service provider to reach its users through Instant Messages. Note that it will work on any type of devices, either mobile or desktops.
List some example applications?
1) Event Management Application: Notifies the user instantly of the event it registers.
2) Order Tracking Application: User is instantly notified if any change occurred in the order status.
Etc. etc.
So, where can you find the SDK? Licensing?
The MSN Alert SDK is downloaded for free from the following URL.
It also contains necessary licensing agreement information as MSN Alerts service in the production setup is not free of cost.
Building our Hello World MSN Alert Application:
The following listing demonstrates a sample Console Application for MSN Alerts. For all the classes, properties and methods involved in the sample, consult the SDK documentation. Note that you need to Add Reference to the Microsoft Notification SDK Type Library (msnotify.dll). This COM Component is automatically registered when you install the Developer’s SDK.
<code>
using System;
using System.Reflection;
using System.Runtime.InteropServices;
// the following namespace is automatically added when you add a
// reference to the Microsoft Notifications SDK Type Library. Because the
// MSN Alerts subsystem is built using COM therefore we need the
// System.Runtime.InteropServices to access the COM objects through
// Managed Code
using MSNOTIFYLib;
namespace AlertSample
{
class MainClass
{
static void SetNotificationValues(MsnNotificationClass Alert)
{
// set notification values
Alert.ID = "1234";
Alert.MessageID = "0";
// this is also fixed with the demo
Alert.SiteID = "140001000";
// directory where the dev edition of the toolkit is installed
Alert.SiteURL = "http://localhost/MsAlertsSdkServer";
// activates when the user clicks on the Alert window
Alert.ActionURL = "/action.asp";
// activates when the user clicks on the 'change' text on the Alert window
Alert.SubscribeURL = "/subscr.asp";
Alert.BodyLanguage = "1033";
// icon shown on the top left corner
Alert.BodyIcon = "/car.png";
// body of the alert message
Alert.Body = "<TEXT>Hello World</TEXT>";
}
static void
{
//
// TODO: Add code to start application here
//
// creating the required objects
MsnNotificationClass Alert = new MsnNotificationClass();
NotificationTransportClass Transport = new NotificationTransportClass();
// setting the destination url
Transport.DestinationUrl = "http://localhost/MSAlertsSDKServer/MSAlertsSDKServer.dll";
// setting username and password
// these values are embedded with the sample toolkit
// therefore these are only for demo purposes
string userName = "Adventure Works";
string password = "password";
SetNotificationValues(Alert);
Console.WriteLine("Alerts Submission System Started");
// passport id, acquire using Passport Sign-in, dummy // in this case to pop-up messages locally.
Alert.ToPID = "0x01234567:0x89abcdef";
Console.WriteLine("XML:");
Console.WriteLine(Alert.GetSerialization());
Transport.SendNotification(1,userName,password,Alert,1);
Transport.DrainNotifications(0);
}
}
}
</code>
After running the sample application, we see the following pop-up appearing from the bottom-right corner of your desktop.

Conclusion:
MSN Alerts Service is an exciting way to develop client centric applications. Your imagination is the only limit here.