Difference between revisions of "Notification.new"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 +
'''<translate>Class</translate>:''' [[Special:MyLanguage/Notification|Notification]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate>Creates new notification object with provided id. Scheduled notifications can later be canceled or modified using provided ID.
 
<translate>Creates new notification object with provided id. Scheduled notifications can later be canceled or modified using provided ID.
Line 14: Line 16:
  
 
However, if you want to display for example, that there are new chat messages from different users, they should have different IDs.</translate>
 
However, if you want to display for example, that there are new chat messages from different users, they should have different IDs.</translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  Notification.new()
 
  Notification.new()
</source>
+
</syntaxhighlight>

Latest revision as of 14:31, 13 July 2023


Available since: Gideros 2011.6
Class: Notification

Description

Creates new notification object with provided id. Scheduled notifications can later be canceled or modified using provided ID.

Here are couple of scenarios that may happen, when creating notifications:

Notification with provided ID does not exist yet, so you simply create new scheduled notification. Next if you create another notification with same ID, while the first one is till scheduled, you will simply modify the existing scheduled notification with new title, message, etc and can even change it's scheduled time by redispatching it. If you create notification with same ID, while the first notification was already displayed, you will simply create a new notification.


So as you see, you may use notification ID's as types of notifications. For example, if you have a energy bar that will be restored after some time, you could always dispatch this notification with same ID.

However, if you want to display for example, that there are new chat messages from different users, they should have different IDs.

 Notification.new()