SolutionsTools & SDKSupportForums Register



Quick Links
 
A Simple Application to Push Alerts to a Phone
 
 
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

Download simpleNotify.zip

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

To build simpleNotify.exe, unpack the simpleNotify.zip file and double click on sendNotify.dsp. This should launch Visual C++, and open the project that is already set up with the appropriate files. Simply press F-7 to build the application.

Running simpleNotify.exe

From a command prompt, simply type simpleNotify <subscriber_id> and an alert with a title of "Alert Me" will be sent to the subscriber_id on devgate2.openwave.com

 
Copyright © 2000-2008 Openwave Systems Inc.    About Us  |  Openwave  |  Terms & Conditions  |  Privacy Policy  |  Update Profile