We were able to set up Airnotifier on a custom Moodle client as well.
Firstly, setup airnotifier by cloning the master branch from airnotifier/airnotifier
. For reference, we are on commit
. All of this is assuming you are forking the official Moodle app, if you are making your own app from scratch then you can checkout crux-bphc/CMS-Android
. For iOS, checkout crux-bphc/CMS-iOS
Let's start with FCM:
Setup an Airnotifier project and provide the FCM project ID and JSON key. You have to setup your Android application to use the FCM config file. For the official Moodle app I believe all you'll need to do is to change the
The Moodle hook for Airnotifier has a bug making it incompatible with APN. Use this fork instead: chaubss/airnotifier
. I did not work on the APN side for our app so I'm not sure what more
there is to it on the Apple side. But the iOS/APN documentation should help you out here.
Once this is done, make sure Airnotifier works by running the server and sending a PUSH request to the Airnotifier API. The Airnotifier repository has a Postman workspace that you can use to test. Once you know Airnotifier works, it should be pretty
straight forward to test with a hosted Moodle instance itself. Note that Moodle doesn't allow a namespace and you need to use a subdomain (i.e you cannot do example.com/airnotifier you need to do airnotifier.example.com). You can check if your
mobile device registers itself to Moodle by using the
mdl_user_devices table. Notifications can be tested by sending messages between two users or by creating discussions and making sure notifications are sent out immediately.
This explanation probably is inadequate, so if you face any trouble, do reach out.