Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Airnotifier manager class

Copyright: 2012 Jerome Mouneyrac <jerome@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 220 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

message_airnotifier_manager:: (6 methods):
  include_device_ajax()
  get_user_devices()
  request_accesskey()
  create_token()
  is_system_configured()
  enable_device()


Class: message_airnotifier_manager  - X-Ref

Airnotifier helper manager class

include_device_ajax()   X-Ref
Include the relevant javascript and language strings for the device
toolbox YUI module

return: bool

get_user_devices($appname, $userid = null)   X-Ref
Return the user devices for a specific app.

param: string $appname the app name .
param: int $userid if empty take the current user.
return: array all the devices

request_accesskey()   X-Ref
Request and access key to Airnotifier

return: mixed The access key or false in case of error

create_token($token, $deviceplatform = '')   X-Ref
Create a device token in the Airnotifier instance

param: string $token The token to be created
param: string $deviceplatform The device platform (Android, iOS, iOS-fcm, etc...)
return: bool True if all was right

is_system_configured()   X-Ref
Tests whether the airnotifier settings have been configured

return: boolean true if airnotifier is configured

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

param: int $deviceid the device id
param: bool $enable  true to enable it, false to disable it
return: bool true if the device was enabled, false in case of error