Read the statement by Michael Teeuw here.
Notification Timer none dosent work
-
Hello guys I trigger a notification with a message but the timer dosend work. Here my simple code snippet:
{ commandId: "Finish", notiID: "SHOW_ALERT", notiPayload: { type: 'notification', message: 'Der Monitor ist eingeschaltet.', timer: 'none'} },
the notification shows already fine but after 2 sek is not to see anymore. I want no timers the notification is always on. I hope u can understand me. I tried already with 0 but still doesn’t work.
thanks
-
@fischi87 notification has to time out, either the notification timer value or the display_time value
-
@fischi87 the doc says do not specify timer
the doc ‘none’ answer means not specified by default
-
do u have a idea how can i set none timer so the notification will display until i cancel it by my self?
with my code the notification is displayed just 3 sek.
-
@fischi87 just don’t specify the timer value
-
@sdetweil how is it possible the make a notification what will display without a timer? i want show a notification and want cancel this notification by my self where my next question is, how can i cancel a notification, is there a way for it? like the alert.
-
@fischi87 just don’t add the timer: value in the notification you send
-
@sdetweil this dont work, it displaed just 3 sek wihout the timer.
-
@fischi87 the doc says, if you don’t specify timer in a notification type, then the config option display_time will be used (and defaults to 3.5 seconds, 3500ms)
if you use an alert type , then no timer value will cause the message to be displayed til removed
note one has a type in the payload (notification type) and one does not (alert type)
so your notification should be
{ commandId: "Finish", notiID: "SHOW_ALERT", notiPayload: { message: 'Der Monitor ist eingeschaltet.' } },
-
ur are right for the alert but with the type notification (SHOW_ALERT with type = notification) are 2 different things. if i send a show alert without a type it displed me the alert with blur background and so on and with the type: notification it shows me a little box with my message and this notification canceled after 3 sek. i didnt set a timer or a display_time, the alert shows as long i want but the notification canceld alter 3 sek. this is my problem!
-
@fischi87 yes, the doc says
if you don’t specify timer in a notification type, then the config option
display_time
will be used (and defaults to 3.5 seconds, 3500ms)
so, add a new property to the alert module config:{} block
(if it doesn’t have a config:{} block, add one)display_time: 7*24*60*60*1000 // 7 days in milliseconds