Send and display content from notification 46/10146/1
authorJean-Benoit MARTIN <jean-benoit.martin@eurogiciel.fr>
Fri, 20 Sep 2013 12:30:32 +0000 (14:30 +0200)
committerJean-Benoit MARTIN <jean-benoit.martin@eurogiciel.fr>
Fri, 20 Sep 2013 12:30:32 +0000 (14:30 +0200)
Change-Id: I609ec048f7ffe34104a0c4cdc2a2bedd2566601d

sample_display_client.c
send_notification.c

index 1f449f0..ccdd255 100644 (file)
@@ -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);
index 52e5686..0a15d86 100644 (file)
@@ -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));