Your MIDlet should retrieve an incoming notification as follows:
Your MIDlet needs to create a session with Notification Enabler by calling the method NotificationSessionFactory.openSession(). The method returns an object reference of class NotificationSession. Now your MIDlet can be used for Nokia Notifications API calls.
Your MIDlet should now call the method NotificationSession.registerApplication() to make your MIDlet go to STATE_ONLINE. When your MIDlet is in STATE_ONLINE, it is able to receive notifications from the Notification Enabler and call most of the methods in Nokia Notifications API.
The following sequence diagram shows how the MIDlet uses the Nokia Notifications API classes to retrieve an incoming notification from the Notification Enabler.
The MIDlet opens the session to the Notification Enabler to be able to use the Nokia Notifications API.
The NotificationSessionFactory method creates a new instance of the NotificationSession.
The NotificationSession is created.
The MIDlet calls NotificationSession.registerApplication method to make the MIDlet registered to receive notifications.
If there are incoming notifications then the Notification Enabler calls NotificationSessionListener.messageReceived method with argument NotificationMessage that includes the content of the notification. This call back method is called once for every incoming notification.
Last updated 9 October 2013
We appreciate your feedback.