From 06d4a8e7425129958d7b05c6fa6f9965b94e16ec Mon Sep 17 00:00:00 2001 From: Jean-Benoit MARTIN Date: Fri, 20 Sep 2013 14:30:32 +0200 Subject: [PATCH] Send and display content from notification Change-Id: I609ec048f7ffe34104a0c4cdc2a2bedd2566601d --- sample_display_client.c | 5 ++++- send_notification.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sample_display_client.c b/sample_display_client.c index 1f449f0..ccdd255 100644 --- a/sample_display_client.c +++ b/sample_display_client.c @@ -11,6 +11,7 @@ static void __noti_changed_cb(void *data, notification_type_e type) char *pkgname = NULL; char *title = NULL; char *str_count = NULL; + char *content = NULL; int i = 1; char buf[512] = {0}; @@ -32,8 +33,10 @@ static void __noti_changed_cb(void *data, notification_type_e type) count = atoi(str_count); } notification_get_title(noti, &title, NULL); + notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &content); - fprintf(stdout, "NOTIFICATION: %s - %s - %i - %i\n", pkgname, title, count, num); + + fprintf(stdout, "NOTIFICATION: %s - %s - %s - %i - %i\n", pkgname, title, content, count, num); get_list = notification_list_get_next(get_list); noti = notification_list_get_data(get_list); diff --git a/send_notification.c b/send_notification.c index 52e5686..0a15d86 100644 --- a/send_notification.c +++ b/send_notification.c @@ -121,7 +121,7 @@ main(int argc, char **argv) } err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, - title ? title : "Default Content", + content ? content : "Default Content", NULL, NOTIFICATION_VARIABLE_TYPE_NONE); if (err != NOTIFICATION_ERROR_NONE) { fprintf(stderr, "Unable to set notification content: %s\n", error_to_string(err)); -- 2.7.4