Class Index | File Index

Classes


Namespace mmir.NotificationManager


Defined in: notificationManager.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
alert(message, alertCallback, title, buttonName)
Opens a (native) alert-notification dialog.
 
beep(times)
Trigger a beep notification sound.
 
confirm(message, alertCallback, title, buttonLabels)
Opens a (native) confirm-notification dialog.
 
createSound(name, url, isKeepOnPause)
Create a sound notification.
 
 
init()
 
initSound(name)
Initialize a sound notification.
 
Check if the execution environment supports #vibrate.
 
Check if #vibrate is functional and enabled.
 
playSound(name, times, onFinished, onError)
Trigger a sound notification by NAME (needs to be created first).
 
Enable or disable #vibrate.
 
setVolume(vol)
Set the volume for sound notifications.
 
stopSound(name)
Stop a sound notification, if it is playing.
 
vibrate(milliseconds)
Trigger a haptic vibration feedback.
Namespace Detail
mmir.NotificationManager
Requires:
Dictionary
mmir.MediaManager
Method Detail
alert(message, alertCallback, title, buttonName)
Opens a (native) alert-notification dialog.
Parameters:
{String} message
the alert message
{Function} alertCallback Optional
callback that is triggered, after dialog was closed
{String} title Optional
OPTIONAL the title for the alert dialog (may not be provided / settable in all execution environments)
{String} buttonName Optional
OPTIONAL the label for the close button in the alert dialog (may not be provided / settable in all execution environments)

beep(times)
Trigger a beep notification sound.
Parameters:
{Number} times
how many times should to beep repeated

confirm(message, alertCallback, title, buttonLabels)
Opens a (native) confirm-notification dialog.
Parameters:
{String} message
the confirm message
{Function} alertCallback Optional
callback that is triggered, after dialog was closed. The callback will be invoked with 1 argument:
callback(wasConfirmed : Boolean)
if the OK/CONFIRM button was pressed, wasConfirmed will be true, otherwise false.
{String} title Optional
OPTIONAL the title for the confirm dialog (may not be provided / settable in all execution environments)
{Array} buttonLabels Optional
OPTIONAL the labels for the buttons of the confirm dialog (may not be provided / settable in all execution environments)

createSound(name, url, isKeepOnPause)
Create a sound notification.

After creation, the sound "theSoundId" can be played via playSound("theSoundId", 1)

Parameters:
{String} name
the name / identifier for the sound
{String} url
the URL for the audio of the sound
{Boolean} isKeepOnPause Optional
OPTIONAL flag indicating, if the audio resources should be keept when the device goes into pause mode (may not apply to all execution environments; e.g. relevant for Android environment)
DEFAULT: false

getInstance()
Deprecated:
instead: use mmir.NotificationManager directly

init()

initSound(name)
Initialize a sound notification.

NOTE a sound does not need to be explicitly initialized, playSound will automatically initialize the sound if necessary.

Initializing a sound prepares all resources, so that the sound can be immediately played. For instance, a sound that needs to loaded from a remote server first, may take some time before it can be played.

NOTE the sound must be #createSound|created first, before initializing it.

Parameters:
{String} name
the name / identifier for the sound
See:
#createSound

{Boolean} isVibrateAvailable()
Check if the execution environment supports #vibrate.

If false is returned, calling the vibrate() function will have no effect.

Returns:
{Boolean} true if #vibrate is functional

{Boolean} isVibrateEnabled()
Check if #vibrate is functional and enabled.

If false is returned, calling the vibrate() function will have no effect.

Returns:
{Boolean} true if #vibrate is functional

playSound(name, times, onFinished, onError)
Trigger a sound notification by NAME (needs to be created first).
Parameters:
{String} name
the name / identifier for the sound (if null, beep notification is used)
{Number} times
how many times should to beep repeated
onFinished
onError
See:
#createSound

setVibrateEnabled(enabled)
Enable or disable #vibrate.

NOTE: If {@ #isVibrateAvailable} returns false, enabling will have no effect.

Parameters:
{Boolean} enabled
set vibrate function to enable

setVolume(vol)
Set the volume for sound notifications.
Parameters:
{Number} vol
the new volume: a number between [0, 1]
See:
mmir.env.media.IAudio#setVolume

stopSound(name)
Stop a sound notification, if it is playing. Has no effect, if the notification is not playing.
Parameters:
{String} name
the name / identifier for the sound

vibrate(milliseconds)
Trigger a haptic vibration feedback.

Note: The device / execution environment may not support haptic vibration feedback

Parameters:
{Number} milliseconds
duration for vibration in milliseconds. Must be > 0

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Feb 26 2016 21:44:43 GMT+0100 (Mitteleuropäische Zeit)