Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
message_airnotifier_manager Class Reference

Airnotifier helper manager class. More...

Public Member Functions

 check_configuration ()
 Check the system configuration to detect possible issues.
 
 get_user_devices ($appname, $userid=null)
 Return the user devices for a specific app.
 
 has_enabled_devices (string $appname, int $userid=null)
 Check whether the given user has enabled devices or not for the given app.
 
 include_device_ajax ()
 Include the relevant javascript and language strings for the device toolbox YUI module.
 
 is_system_configured ()
 Tests whether the airnotifier settings have been configured.
 
 request_accesskey ()
 Request and access key to Airnotifier.
 
 send_test_notification (stdClass $user)
 Send a test notification to the given user.
 

Static Public Member Functions

static enable_device ($deviceid, $enable)
 Enables or disables a registered user device so it can receive Push notifications.
 

Public Attributes

string const AIRNOTIFIER_PUBLICURL = 'https://messages.moodle.net'
 The Airnotifier public instance URL.
 
int const ENCRYPT_UNSUPPORTED_NOT_SEND = 0
 Avoid sending notifications to devices not supporting encryption.
 
int const ENCRYPT_UNSUPPORTED_SEND = 1
 Send notifications to devices not supporting encryption.
 

Detailed Description

Airnotifier helper manager class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ check_configuration()

message_airnotifier_manager::check_configuration ( )

Check the system configuration to detect possible issues.

Return values
arrayresult checks

◆ enable_device()

static message_airnotifier_manager::enable_device ( $deviceid,
$enable )
static

Enables or disables a registered user device so it can receive Push notifications.

Parameters
int$deviceidthe device id
bool$enabletrue to enable it, false to disable it
Return values
booltrue if the device was enabled, false in case of error
Since
Moodle 3.2

◆ get_user_devices()

message_airnotifier_manager::get_user_devices ( $appname,
$userid = null )

Return the user devices for a specific app.

Parameters
string$appnamethe app name .
int$useridif empty take the current user.
Return values
arrayall the devices

◆ has_enabled_devices()

message_airnotifier_manager::has_enabled_devices ( string $appname,
int $userid = null )

Check whether the given user has enabled devices or not for the given app.

Parameters
string$appnamethe app to check
int$useridthe user to check the devices for (empty for current user)
Return values
booltrue when the user has enabled devices, false otherwise

◆ include_device_ajax()

message_airnotifier_manager::include_device_ajax ( )

Include the relevant javascript and language strings for the device toolbox YUI module.

Return values
bool

◆ is_system_configured()

message_airnotifier_manager::is_system_configured ( )

Tests whether the airnotifier settings have been configured.

Return values
booleantrue if airnotifier is configured

◆ request_accesskey()

message_airnotifier_manager::request_accesskey ( )

Request and access key to Airnotifier.

Return values
mixedThe access key or false in case of error

◆ send_test_notification()

message_airnotifier_manager::send_test_notification ( stdClass $user)

Send a test notification to the given user.

Parameters
stdClass$useruser object

The documentation for this class was generated from the following file: