0

I´m new to Tizen, and I tried to develop a wearable native App (2.3.2) where notifications can be created by clicking on a button. So far it works, but I was wondering whether the notifications could be customized.

My questions:

  1. I'd like to insert a button for user interaction on the notifications. Is this possible? Is there any other way for creating a button on a notification or is this not possible in Tizen 2.3.2 for wearables?
  2. Is there a way to customize the popup which is (automatically?) shown every time a new notification is created (e.g. add App icon, show part of notification content...)?
  3. I´m not sure what time is displayed there at all - it seems completely random to me while testing on the emulator. Is it possible to delete the time stamp shown under the notification title in the notification tray? The time stamp on an notification should be possible to modify by notification_set_time(notification, time(NULL));, but it didn't work for me. Just showed completely random values (not the actual system time; same as notification_set_time_to_text at code line 9). Nothing changed in the displayed notification. When I tried instead to delete the time stamp with notification_set_time(notification, DO_NOT_SHOW_TIMESTAMP), it gave an error( DO_NOT_SHOW_TIMESTAMP is unknown).

Below is a part of the code that covers the whole function which creates the notification and sets its content. In Line 20 (marked as comment) I tried to add a button with notification_set_button, but this caused an error.

    void set_notification(appdata_s *ad){
    notification_h notification = NULL;
    notification = notification_create(NOTIFICATION_TYPE_NOTI);
    if(notification != NULL){

    notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, 
    "Alarm",
    NULL, NOTIFICATION_VARIABLE_TYPE_NONE);

    notification_set_time_to_text(notification, time(NULL), 
    NOTIFICATION_TEXT_TYPE_CONTENT);
    notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, 
    "Failure 
    of Valve 4",
    NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
    notification_set_display_applist(notification, 
    NOTIFICATION_DISPLAY_APP_ALL);
    notification_set_size(notification, 0.5);
    notification_set_layout(notification, NOTIFICATION_LY_ONGOING_EVENT );
    //notification_add_button(notification,NOTIFICATION_BUTTON_1);
    notification_set_vibration(notification, 
    NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
    }
    app_control_h app_control = NULL;
    int noti_err = NOTIFICATION_ERROR_NONE;

    app_control_create(&app_control);
    app_control_set_app_id(app_control, "org.tizen.noti_basicui2");

    noti_err = notification_set_launch_option(notification, 
    NOTIFICATION_LAUNCH_OPTION_APP_CONTROL,
    (void *) app_control);
    if (noti_err != NOTIFICATION_ERROR_NONE) {
    notification_free(notification);
    return;
     }
    app_control_destroy(app_control);
    notification_post(notification);
    }
Community
  • 1
  • 1
newsy
  • 1
  • 2
  • Please avoid asking multiple questions withing the same post. Which part of your question is the code related to? On which line of the code is the problem? Please see [mcve]. – Dev-iL Aug 20 '17 at 16:26
  • Sorry for the multiple questions in one post. Thank you for your feedback. The code covers the whole function which creates the notification and sets its content. In Line 20 (marked as comment) I tried to add a button with notification_set_button, but this creates an Error. Is there any other way for creating a button on a notification or is this not possible in TIzen 2.3.2 for wearables? – newsy Aug 21 '17 at 17:39
  • The time stamp on an notification should be possible to modify by notification_set_time(notification, time(NULL));, but it didn´t work. Just showed completely random values, not the actual system time,same as notification_set_time_to_text ( code line 9). Nothing changed in the displayed notification. And when I tried instead to delete the time stamp with notification_set_time(notification, DO_NOT_SHOW_TIMESTAMP), it gives an error( DO_NOT_SHOW_TIMESTAMP is unknown). – newsy Aug 21 '17 at 17:50
  • And to the last question: I can´t say which line is responsible for creating the popup when a notification is created. Either both appearing or none of them. – newsy Aug 21 '17 at 17:53
  • It's good that you provided clarifications! Next time, please use the [edit] button when appropriate to add further information. I'm assuming you wanted to add links to your post, but you don't have enough reputation to be able to do that. For now, you can specify the links as text and wait for somebody (like myself) to edit them in (assuming, of course, they're legit). Just so it's clear - I personally don't possess the necessary knowledge to answer your question; I'm merely providing pointers that would hopefully increase your chances of getting an actual answer. – Dev-iL Aug 21 '17 at 18:55
  • See link https://developer.tizen.org/forums/native-application-development/customize-notifications-wearable-2.3.2-tizen-native#comment-25626. – Yasin shihab Aug 22 '17 at 06:05
  • @ Yasin shihab: Thank you for the link, that´ll solve my questions. @ Dev-iL: Thank you for your help with editing and clarifying the question – newsy Aug 22 '17 at 17:15

0 Answers0