In sending notifications to mobile device you need to write a code for it
First you will create the events for that
//Currently it will raise only for android devices
static void DeviceSubscriptionChanged(object sender,
string oldSubscriptionId, string newSubscriptionId, INotification notification)
{
//Do something here
}
//this even raised when a notification is successfully sent
static void NotificationSent(object sender, INotification notification)
{
//Do something here
}
//this is raised when a notification is failed due to some reason
static void NotificationFailed(object sender,
INotification notification, Exception notificationFailureException)
{
//Do something here
}
//this is fired when there is exception is raised by the channel
static void ChannelException
(object sender, IPushChannel channel, Exception exception)
{
//Do something here
}
//this is fired when there is exception is raised by the service
static void ServiceException(object sender, Exception exception)
{
//Do something here
}
//this is raised when the particular device subscription is expired
static void DeviceSubscriptionExpired(object sender,
string expiredDeviceSubscriptionId,
DateTime timestamp, INotification notification)
{
//Do something here
}
//this is raised when the channel is destroyed
static void ChannelDestroyed(object sender)
{
//Do something here
}
//this is raised when the channel is created
static void ChannelCreated(object sender, IPushChannel pushChannel)
{
//Do something here
}
Then the events handler for associating to the events
//create the puchbroker object
var push = new PushBroker();
//Wire up the events for all the services that the broker registers
push.OnNotificationSent += NotificationSent;
push.OnChannelException += ChannelException;
push.OnServiceException += ServiceException;
push.OnNotificationFailed += NotificationFailed;
push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
push.OnChannelCreated += ChannelCreated;
push.OnChannelDestroyed += ChannelDestroyed;
0 Comment(s)