View Source

h2. Push API

The Push API is available and valid only when ICEpush is enabled for the application.


The following Form APIs are available:

* *{{[ice.onBlockingConnectionLost(callback)|#onBlockingConnectionLost]}}*
* *{{[ice.onBlockingConnectionServerError(callback)|#onBlockingConnectionServerError]}}*
* *{{[ice.onBlockingConnectionUnstable(callback)|#onBlockingConnectionUnstable]}}*

----

\\
{anchor:onBlockingConnectionLost}
{panel}
h4. ice.onBlockingConnectionLost(callback)

Accepts a reference to a callback function. The callback function will be invoked when the blocking connection to the server has been lost and is considered unrecoverable.

_Usage:_

{code:javascript}var connectionLostHandler = function(reconnectionAttempts) {
...
};
ice.onBlockingConnectionLost(connectionLostHandler);
{code}
{_}Parameters:_

* reconnectionAttempts
bq. The number of reconnect attempts made by the bridge to re-establish the connection before considering the connection unrecoverable.
{panel}
\\
{anchor:onBlockingConnectionServerError}
{panel}
h4. ice.onBlockingConnectionServerError(callback)

Accepts a reference to a callback function. The callback function will be invoked when a server error is received by the browser on the blocking connection.

_Usage:_

{code:javascript}var serverErrorHandler = function(statusCode, responseText, responseDOM) {
...
};
ice.onBlockingConnectionServerError(serverErrorHandler);
{code}
{_}Parameters:_

* statusCode
bq. The HTTP status code.

* responseText
bq. The body of the HTTP response in text format.

* responseDOM
bq. The parsed body of the HTTP response as XML. This parameter is present only when response is in XML/HTML format.
{panel}
\\
{anchor:onBlockingConnectionUnstable}
{panel}
h4. ice.onBlockingConnectionUnstable(callback)

Accepts a reference to a callback function. The callback function will be invoked when the client bridge's hearbeat detects that the server isn't responding in a timely fashion.

_Usage:_

{code:javascript}var connectionUnstableHandler = function() {
...
};
ice.onBlockingConnectionUnstable(connectionUnstableHandler);
{code}
{_}Parameters:_

* none
{panel}
\\