Issues with Moodle Mobile app

Issues with Moodle Mobile app

by Sarath P -
Number of replies: 16
Picture of Plugin developers
Hello everyone,

I have a Moodle site and I have also configured AirNotifier to send push notifications. Today I took a new app build and was testing the notifications and other functionalities. However, I am facing two issues.

1. As admin when I send a message to a user, the app gets closed.

I logged in to the app as a student and from the web as admin, I send a message to that student user. Immediately after sending the message the app gets closed. I tried 2-3 times. Every time I send a message to the user, the app closes.

2. Unable to receive push notifications

As per Moodle, everything is configured correctly. Please find the below screenshot:



I am also getting the payloads in the Airnotifier logs but still, I am not getting any notifications. Please find the below screenshot:



Can someone please tell me how to resolve the issues? 

Moodle version: 4.1.3+ (Build: 20230602)
Mobile app version: 4.3.0 (43000)

Thanks in Advance

 
Average of ratings: -
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
I managed to solve the push notification issue. However, I am still stuck with:

1. As admin when I send a message to a user, the app gets closed.

Is it a bug?
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Isabel Renedo -
Picture of Moodle HQ Picture of Particularly helpful Moodlers
Hi Sarath,

>>1. As admin when I send a message to a user, the app gets closed.
I wasn't able to reproduce it. 


Kind regards,
Isabel
In reply to Isabel Renedo

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
Hi Isabel,

I tried that as well. I tried on two different phones with one Microsoft login and another manual login. Unfortunately, every time I send a message, the app gets closed. Today I took a new app build and tried again. Now not only messages, but even a forum post will also make the app close.
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Ardian Deari -
There seems to be an issue with AirNotifier. The problem lies with your payload, as it is not properly configured and is causing your app to crash. This is a well-known problem that needs to be addressed.
In reply to Ardian Deari

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
Hi Ardian,

After setting up the AirNotifier server and testing the app for the initial time, I was able to get forum post notifications as push notifications. But now even a forum post is making the app close. How to check and make sure that everything is configured properly? I tried to test from Moodle, however, I am getting the following error:

In reply to Sarath P

Re: Issues with Moodle Mobile app

by Ardian Deari -
The screenshot you attached shows the connection between your Moodle and AirNotifier. Please ensure that you double-check the payload for both iOS and Android. Additionally, make sure that you have downloaded the correct google-service files from Firebase and placed them in the root folder.
However, my main suspicion regarding this issue lies with the payload. It's important to note that this customization is not supported by Moodle, as AirNotifier is designed exclusively for their customers.
In reply to Ardian Deari

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
I just tested sending notification by curl AIRNOTIFIER_URL/api/v2/push -X POST -H "X-AN-APP-NAME: APP_ID" -H "X-AN-APP-KEY: AIRNOTIFIER_ACCESS_KEY" --data '{"device": "android-fcm", "token": "DEVICE_TOKEN", "extra": {"processor" : "moodle", "notification": 1, "subject": "Title test", "fullmessage": "Message test"}}'
I have noticed two things:

1) While sending the notification if the app is open the app gets closed
2) If the app is not opened I am able to get the notification.



At the moment I am trying only for Android.
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Ardian Deari -
What about when you send notifications directly from google firebase. Does it crash your app?
In reply to Ardian Deari

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
I just send a notification from Firebase by creating a Campaign -> Notification. There was a huge delay in receiving the notification but received it while the app was in closed state. I tried once again by keeping the app open. However, the notification is not yet received. Still waiting...
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Sarath P -
Picture of Plugin developers
Still my app is getting closed while sending push notification. I tried again by
curl AIRNOTIFIER_URL/api/v2/push -X POST -H "X-AN-APP-NAME: APP_ID" -H "X-AN-APP-KEY: AIRNOTIFIER_ACCESS_KEY" --data '{"device": "android-fcm", "token": "DEVICE_TOKEN", "extra": {"processor" : "moodle", "notification": 1, "subject": "Title test", "fullmessage": "Message test"}}'
and the notification is delivered successfull only if the app is already closed. If not, the app will close without displaying the notification.

Is it a bug in the app?
In reply to Sarath P

Re: Issues with Moodle Mobile app

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers
Hi Sarath,

the app works fine with our Airnotifier instance, but we have customised it to support some extra features. It's possible that the crash you're seeing is caused by the encrypted push notifications support that was recently included in the app. You can check the Android log (LogCat) to see more details about the error.

Unfortunately, we don't provide support for custom Airnotifier instances. As Ardian said above, it's important that the payload sent by Airnotifier is correct. The encrypted push I mentioned above was developed by Catalyst, and as far as I know they used this Airnotifier branch. You might want to try it out to see if it fixes your issue.

Cheers,
Dani


In reply to Dani Palou

Re: Issues with Moodle Mobile app

by Govindaprasath E -
Has anyone tried this version of Airnotifier? Did this solve the problem?
In reply to Govindaprasath E

Re: Issues with Moodle Mobile app

by Deds Castillo -
Picture of Plugin developers
I tried it but the app closing still happens. I'm trying on an old build of the app though. I'll try it on a newer build in the next few days.