Listener interface for Push Connection state transitions (deprecated). More...
Errors and state changes that occur when using PushConnection are handled by creating a class that implements this protocol.
The following code snippets illustrate some common tasks.
The above snippet shows a very simple handler for PushConnection state-change. The availability of the Push Channel service is written to the system log.
The above snippet shows how the above handler could be associated with the Push Connection.
Public Member Functions | |
void | onStatus (int status) |
Callback for all status changes. More... | |
void onStatus | ( | int | status | ) |
The callback is invoked when the Push Connection changes state, or when an error occurs.
The method that is invoked could call isConnected to determine the availability of the following features:
If the features are available (i.e. isConnected
returns true
), then any of the following actions that were waiting could now proceed:
If the features are not available (i.e. isConnected
returns false
) then the method that is invoked could alert the user, or display this as an ongoing state. In this state, Push Channel notifications would not be received.
status | Internal numeric code for the new status. Specific values are not documented, and should not be relied upon. |
During establishment or termination of the Push Connection with the BlackBerry Dynamics proxy infrastructure, see GDPush
Connection
connect and disconnect , the callback will be invoked a number of times, as the action progresses.
Events that have an impact on the state of the Push Connection also result in the callback being invoked. This would include loss of network coverage and other losses of data connection, as well as the subsequent automatic re-establishment of the connection.