Difference between revisions of "NotificationManager:cancelNotification"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Cancel specific scheduled notification by it's ID. Basically it's the same as creating new notificati...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| − | '''Available since:''' Gideros 2011.6<br/> | + | <languages /> |
| − | === Description === | + | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> |
| − | Cancel specific scheduled notification by it's ID. | + | '''<translate>Class</translate>:''' [[Special:MyLanguage/NotificationManager|NotificationManager]]<br/> |
| + | === <translate>Description</translate> === | ||
| + | <translate>Cancel specific scheduled notification by it's ID. | ||
| − | Basically it's the same as creating new notification with same ID and cancelling it: | + | Basically it's the same as creating new notification with same ID and cancelling it:</translate> |
| − | < | + | <syntaxhighlight lang="lua"> |
| − | = NotificationManager:cancelNotification() | + | NotificationManager:cancelNotification() |
| − | </ | + | </syntaxhighlight> |
| + | === <translate>Examples</translate> === | ||
| + | '''Cancel notification'''<br/> | ||
| + | <syntaxhighlight lang="lua">--id of notification to cancel | ||
| + | local id = 1 | ||
| + | |||
| + | --cancel through notification isntance | ||
| + | local notification = Notification.new(id) | ||
| + | notification:cancel() | ||
| + | |||
| + | --cancel through NotificationManager | ||
| + | local mngr = NotificationManager:getSharedInstance() | ||
| + | mngr:cancelNotification(id)</syntaxhighlight> | ||
Latest revision as of 15:32, 13 July 2023
Available since: Gideros 2011.6
Class: NotificationManager
Description
Cancel specific scheduled notification by it's ID.
Basically it's the same as creating new notification with same ID and cancelling it:
NotificationManager:cancelNotification()
Examples
Cancel notification
--id of notification to cancel
local id = 1
--cancel through notification isntance
local notification = Notification.new(id)
notification:cancel()
--cancel through NotificationManager
local mngr = NotificationManager:getSharedInstance()
mngr:cancelNotification(id)