|
A command line notification tool using the Notification Libraries v3.0 from the UP.SDK Introduction The UP.Link Notification Library and API v3.1 includes functions that allow you to push notifications directly to any UP.Link subscriber's phone. This technical note and companion sample application describe how use the notification COM object in conjunction with Microsoft Visual C++ to post an alert to a subscriber. The code is meant for demonstration purposes only and by no means exercises the complete notification library. For a more detailed example, please see the SendNtfn sample application that ships with the UP.SDK. NOTE: The example code included with this technical note is written in C++ It uses the COM version of the UP.Link Notification Library that ships with the UP.SDK v3.1. It is designed to run on the Windows platform only, and depends on Microsoft Visual C++ . In addition to the COM object, this sample application relies on several files that are shipped with the UP.SDK as part of the sample code for the SendNtfn application. They are as follows: ntfndef.h, UPnotify.h, and UPnotify_i.c, and have been included in the simpleNotify.zip file for your convenience. For more information on sending notifications using the UP.Link Notification Library and API, please refer to UP.SDK Developer's Guide and the UP.SDK Tools and API Reference Guide The simpleNotify.cpp Source Code The simpleNotify application is written all in a main() function for simplicity sake, and the flow of the application is as follows: Step 1: Check to see if the application received at least one command line argument. If so, assume that it is a valid subscriber ID on the devgate2.uplanet.com UP.Link. If there are no arguments to the application, exit, and provide a usage message. Step 2: Initialize the COM object and create a pointer to the Notification Interface Step 3: Declare and initialize the variables to be used in the actual notification. Step 4: Convert the const char * strings into a format suitable for passing to the COM object Step 5: Set the UP.Link that is the destination of the notification Step 6: Send the Notification Step 7: Report to the command line success or failure of sending the notification. Please not that this success or failure is of the UP.Link accepting the alert, not the alert arriving at its ultimate destination. Step 8: Unhand the pointer to the Notification Interface and Unload the COM Object.
Building simpleNotify.exe |