Namespace: notification

jsxc. notification

This namespace handles the Notification API.
Source:

Members

<static> audio

Current audio file.
Source:

Methods

<static> hasPermission() → {Boolean}

Check permission.
Source:
Returns:
True if we have the permission
Type
Boolean

<static> hasSupport() → {Boolean}

Checks if browser has support for notifications and add on chrome to the default api.
Source:
Returns:
True if the browser has support.
Type
Boolean

<static> init()

Register notification on incoming messages.
Source:

<static> muteSound(external)

Mute sound.
Parameters:
Name Type Description
external boolean True if triggered from external tab. Default: false.
Source:

<static> notify(title, msg, d, force, soundFile, loop, source)

Shows a pop up notification and optional play sound.
Parameters:
Name Type Description
title Title
msg Message
d Duration
force Should message also shown, if tab is visible?
soundFile Playing given sound file
loop Loop sound file?
source Bid which triggered this notification
Source:

<static> playSound(soundFile, loop, force)

Plays the given file.
Parameters:
Name Type Description
soundFile string File relative to the sound directory
loop boolean True for loop
force boolean Play even if a tab is visible. Default: false.
Source:

<static> prepareRequest()

Ask user on first incoming message if we should inform him about new messages.
Source:

<static> requestPermission()

Request notification permission.
Source:

<static> stopSound()

Stop/remove current sound.
Source:

<static> unmuteSound(external)

Unmute sound.
Parameters:
Name Type Description
external boolean True if triggered from external tab. Default: false.
Source: