Languages

Menu
Sites
Language
How can I detect when New Notification is posted

hello, everyone watching this topic.

I want to detect  when some Notification is posted by any tizen app, by using Tizen native api.

in Tizen native api 2.4 beta, It supports to detect some events like powerOn/Off, but doesn't support events about notification.

Is there way to detect when notification is posted, and extract data like title,text?

In Android, This is supported by using NotificationListenerService.

 

in summary,

how can I detect Notification Posted Event?

Responses

2 Replies
Jean Yang

Hi, you can find it in the tutorial.

Displaying the Notification Status

To display the notification status:

1.Define the message and register the callback for tracking the message status:
notification_status_monitor_message_cb_set(_notification_status_message_cb, NULL);

notification_status_message_post("Example 2 Msg.");

notification_status_monitor_message_cb_unset();


2.When the message is posted on screen, the callback function is invoked:
static void _notification_status_message_cb(const char *message, void *data)
{
   dlog_print(DLOG_INFO, "NOTIFICATION", "Callback: %s\n", message);
}

Below is the tutorial link:

https://developer.tizen.org/development/tutorials/native-application/application-framework/notification-0#status