Description:
The GetNotification method notifies the client
when the value of a system
attribute is changed.
This is an asynchronous method.
Syntax:
GetNotification(parameters:Object, callback:Object):Object
Arguments:
parameters:
This is an object that specifies the system attribute to monitor for changes. For more information about the object properties and how to define them, see section Parameters for change notifications.
callback:
The callback argument is the name of the method
that is executed when a GetNotification 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 GetNotification method returns an object that
contains the initial return value for the asynchronous call it started (see
the following table). The actual notification information is returned by the callback method
in the ReturnValue property of its result object.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is a number used as an identification to match transactions started
with the asynchronous |
|
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
|
Property |
Description |
Value |
|---|---|---|
|
|
This is an object (a system attribute object) that contains the information for the changed system attribute. This object contains the properties For example, if you request notification for the
|
See System attributes. |
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
Remarks:
GetNotification returns notifications
until cancelled with Cancel.
Only some system attributes can be monitored for changes.
To find out which system attributes support GetNotification,
see section Supported system attributes (entities and keys).
Example code:
The following sample code illustrates how
to register a callback method to receive notifications
of changes in a system attribute value:
import com.nokia.lib.Service;
var sysInfo = new Service("Service.SysInfo", "ISysInfo");
var inParams = {Entity:"General", Key:"PredictiveText"};
sysInfo.GetNotification(inParams,onNotify);
function onNotify(transactionID:Number, eventID:String, outParam:Object) {
var systemData = outParam.ReturnValue;
var Status = systemData.Status;
}