RequestNotification()

Description:

The RequestNotification method registers the Flash Lite application to receive notifications of changes to the event log.

This is an asynchronous method.

Syntax:

RequestNotification(parameters:Object, callback:Object):Object

Arguments:

  • parameters:

    This is an object that specifies the request for notification of changes to the event log. For more information about the object properties and how to define them, see section Parameters for requesting notification.

  • callback:

    The callback argument is the name of the method that is executed when an asynchronous RequestNotification call has results or status information to return. You must define this method separately. Follow the instructions in section Defining the callback handler for an asynchronous method to define the callback method.

Return value:

The RequestNotification method returns an object that contains a transaction ID for the callback instance, an error code, and an error message (see the following table). When the asynchronous call has completed, callback returns an object that contains an error code and an error message (see Table: Callback return value).

Table: Return value properties for an asynchronous RequestNotification

Property

Description

Value

TransactionID

This is a number used as an identification to match transactions started with the asynchronous GetList call to one or more calls it generates to callback.

This property is only valid for asynchronous calls.

 

ErrorCode

This is a number that specifies a predefined error code.

See Service API error codes.

ErrorMessage

This is a text string that describes the error.

Example code:

The following sample code illustrates how to register for the changes occurring to the event log:

import com.nokia.lib.Service;
var logging = new Service("Service.Logging", "IDataSource");
var filter = {DelayTime:30000};
var inParams = {Type:"Log", Filter:filter};

logging.RequestNotification(inParams,onNotify);
function onNotify (transactionID:Number, eventID:String, outParam:Object) {
    var errorId = outParam.ErrorCode;
}