How to send a Toast notification

We have learned how create object to send a notification, now we can send the notification.

How you can see, all previous documentation is summarized in this script.

//get token
$tok = GetToken();
//get a channel
$cha = GetNewChannel();
$Options = new WindowsNotification\WNSNotificationOptions();
$Options->SetAuthorization(new WindowsNotification\OAuthObject($tok)));
$Options->SetX_WNS_REQUESTFORSTATUS(WindowsNotification\X_WNS_RequestForStatus::Request);
$Notifier = new WindowsNotification\WindowsNotificationClass($Options);
//Send a ToastText02 with custom sounds
$Notifier->Send($cha,WindowsNotification\TemplateToast::ToastText02("HELLO!","I'm the message!!!!",WindowsNotification\TemplateToast::NotificationMail));
 
$cha = GetNewChannel();
//Send a ToastText01 to another channel
$Notifier->Send($cha,WindowsNotification\TemplateToast::ToastText01("HELLO!"));
 
$cha = GetNewChannel();
//Send a ToastText01 to another channel with local sound
$Notifier->Send($cha,WindowsNotification\TemplateToast::ToastText01("HELLO!"),WindowsNotification\TemplateToast::CustomSound("<my local url>");

Last edited May 16, 2015 at 4:28 PM by Andreabbondanza, version 7