notifications.cancelNotification()

Type Function
Return value none
Revision 2018.3333
Keywords notification, notifications, cancelNotification
See also notifications.scheduleNotification()
notifications.*

Overview

Removes the specified notification (or all notifications) from the scheduler, status bar, and/or notification center.

Syntax

notifications.cancelNotification( [notificationId] )
notificationId (optional)

A notification reference ID returned by notifications.scheduleNotification(). If no ID is passed, all notifications are cancelled.

Example

local notifications = require( "plugin.notifications.v2" )

-- Schedule a notification
local options = {
    alert = "Wake up!"
}

local notificationId = notifications.scheduleNotification( 60, options )

-- Cancel the above notification
notifications.cancelNotification( notificationId )