Following are some general steps for debugging notifications:
Note that the expiration time is specified in seconds. To specify the longest TTL allowed by the UP.Link server, specify a TTL of 0.
The Common-name of the certificate must match exactly, or be an immediate subdomain of, the domain that hosts the notification alert and pull URLs.
When you post a notification request, the UP.Link server generates a response with an HTTP code, indicating whether the UP.Link server accepted or rejected the notification.
If you are using the COM library with C++, the notification request function (e.g. PostAlert or PostPrefetch) returns the response code from the UP.Link server. If you are using the COM library with Basic or Perl, you can examine the response by calling NtfnGetLastResult and NtfnGetErrorDetail. To examine the response with the UNIX C++ library, check the value returned by the PostAlert() or PostPrefetch() call and use GetErrorDetail().
For a description of status codes returned by the UP.Link server, see Checking codes returned by the UP.Link server.
UP.SDK notification utilities and APIs allow you to request information on the status of individual notifications: you can determine whether a notification has been delivered, expired, or deemed undeliverable. To check the notification status with the COM library, use NtfnGetStatus; with the UNIX C++ library, use GetNtfnStatus().
If you have login access to the UP.Link server, you can also use a Web interface to check the status of notifications. For instructions, Checking notification status on the UP.Link server.
When the UP.Link server receives a notification request, it returns one of the HTTP status codes in the table below. How you get this status code depends on the tool or API you are using to send notification requests:
upnotify (commandline)--see the messages sent to standard output
NtfnGetLastResult method (see Example: using Visual Basic to send a non-secure push notification containing an alert).
PostAlert(), PostCacheOp(), or PostPrefetch() method.
-1 error value, this indicates a general I/O failure has occurred. The most common cause of this error is that a corporate firewall is blocking the destination notification port.
| HTTP Code | Description |
|---|---|
|
200
| The notification status request was accepted by the UP.Link server. |
|
204
| The notification addition request succeeded: the notification was added by the UP.Link server. The notification deletion request succeeded: the notification was deleted by the UP.Link server. |
|
400
| The notification failed because one of the following was missing or invalid:
The most frequent cause for the Before you retry the notification request, make sure all of the data described above are correct. |
|
403
| The notification request failed: your application does not have permission to make requests to the specified UP.Link server. To determine requirements for issuing notifications on an UP.Link server, consult with the UP.Link server administrator. |
|
404
| The notification deletion or status request failed. The specified notification is not pending on the UP.Link server. This could be because of any of the following: |
|
503
| The notification request failed: the request was valid and authorized. However, the UP.Link server was unable to accept the notification for delivery. Wait and retry the request after a while. |
UP.SDK APIs allow you to request more detailed error information when the UP.Link returns an error code:
NtfnGetErrorDetail.
GetErrorDetail().
For more information on these methods, see the "COM Notification Library Reference" and "C++ Notification Library Reference" chapters of the UP.SDK Tools and APIs Reference.
If you have login access to the UP.Link server that you are sending notifications to, you can easily determine the disposition of individual notifications on the UP.Link server. For example, you can determine how long it has been since the UP.Link server received a notification and whether the notification has been successfully delivered.
If you register as an Unwired Planet developer, you can request a username and password which will allow you to log in Unwired Planet's Developer Support UP.Link server (updev.uplanet.com). For instructions on getting a username and password, see the Unwired Planet's Developer Support Web pages.
This is useful for debugging notifications. In particular, if your application appears to be sending notifications successfully, but the UP.Phone does not appear to be receiving them, you should check the notification status on the UP.Link server.
To the check the status of pending or recently delivered notifications on an UP.Link server:
To log in to the provisioning pages of an UP.Link server, you need a username and a password from the UP.Link server administrator.
The UP.Link server provisioning pages allow you to search for individual subscribers. For instructions on searching for subscribers, see the UP.Simulator chapter of the UP.SDK Tools and APIs Reference.
The following table describes the fields in the Subscriber Notifications list.
FIGURE 5-10. Subscriber notifications page
The following sections describe some common problems with notifications.
If you send a secure notification that specifies a URL that is not valid for your certificate--for example, if the notification URL is http://mycompany.com but the Common-Name for your certificate is ntfn.www.mycompany.com, the following can happen: