Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

Airnotifier message processor to send messages to the APNS provider: airnotfier. (https://github.com/dcai/airnotifier)

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

Defines 1 class

message_output_airnotifier:: (6 methods):
  send_message()
  encrypt_payload()
  config_form()
  process_form()
  load_data()
  is_system_configured()


Class: message_output_airnotifier  - X-Ref

Message processor class

send_message($eventdata)   X-Ref
Processes the message and sends a notification via airnotifier

param: stdClass $eventdata the event data submitted by the message sender plus $eventdata->savedmessageid
return: true if ok, false if error

encrypt_payload(stdClass $payload, stdClass $devicetoken)   X-Ref
Encrypt the notification payload.

param: stdClass $payload The notification payload.
param: stdClass $devicetoken The device token record
return: stdClass

config_form($preferences)   X-Ref
Creates necessary fields in the messaging config form.

param: array $preferences An array of user preferences

process_form($form, &$preferences)   X-Ref
Parses the submitted form data and saves it into preferences array.

param: stdClass $form preferences form class
param: array $preferences preferences array

load_data(&$preferences, $userid)   X-Ref
Loads the config data from database to put on the form during initial form display

param: array $preferences preferences array
param: int $userid the user id

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

return: boolean true if airnotifier is configured