We have learned how create object to send a notification, now we can send the notification.
How you can see, this script contains all the things of previous documentation.
In Tile’s cases, we haven't a class with defined templates, so we need to go here to see the catalog.
So, now we can send a tile notification
//get token $tok = GetToken(); //get a channel $cha = GetNewChannel(); $MyTileXML = '<tile> <visual> <binding template="TileWidePeekImageCollection01"> <image id="1" src="image1.png" alt="larger image"/> <image id="2" src="image2.png" alt="small image, row 1, column 1"/> <image id="3" src="image3.png" alt="small image, row 1, column 2"/> <image id="4" src="image4.png" alt="small image, row 2, column 1"/> <image id="5" src="image5.png" alt="small image, row 2, column 2"/> <text id="1">Text Field 1 (larger text)</text> <text id="2">Text Field 2</text> </binding> </visual> </tile> <tile> <visual version="2"> <binding template="TileWide310x150PeekImageCollection01" fallback="TileWidePeekImageCollection01"> <image id="1" src="image1.png" alt="larger image"/> <image id="2" src="image2.png" alt="small image, row 1, column 1"/> <image id="3" src="image3.png" alt="small image, row 1, column 2"/> <image id="4" src="image4.png" alt="small image, row 2, column 1"/> <image id="5" src="image5.png" alt="small image, row 2, column 2"/> <text id="1">Text Field 1 (larger text)</text> <text id="2">Text Field 2</text> </binding> </visual> </tile>'; $Options = new WindowsNotification\WNSNotificationOptions(); $Options->SetAuthorization(new WindowsNotification\OAuthObject($tok))); $Options->SetX_WNS_REQUESTFORSTATUS(WindowsNotification\X_WNS_RequestForStatus::Request); //NOTE: Set the Tile type $Options->SetX_WNS_TYPE(WindowsNotification\X_WNS_Type::Tile); $Notifier = new WindowsNotification\WindowsNotificationClass($Options); //send a tile
$Notifier->Send($cha,$MyTileXML);