crux-bphc / CMS-Android

A custom Moodle app for the students of BITS Pilani, Hyderabad Campus.
MIT License
28 stars 39 forks source link

Mark as read not synchronized between app and website #319

Open Victor-Titan opened 3 years ago

Victor-Titan commented 3 years ago

Course notifications which have been opened in the website do not mark that course module as read in the app. In the same way, opening a new course module in the app does not mark it as read on opening the notifications in the website.

abhijeetviswa commented 3 years ago

The app keeps track of read/unread status locally. While the same notification shows up on the website and for the app, reading it at one place does not do the same in the other place. The goal is to eventually add a notification view so that you can view old notifications on your phone just like you would on the website.

Victor-Titan commented 3 years ago

The app keeps track of read/unread status locally. While the same notification shows up on the website and for the app, reading it at one place does not do the same in the other place. The goal is to eventually add a notification view so that you can view old notifications on your phone just like you would on the website.

Do we have the functionality for that in the Moodle API?

abhijeetviswa commented 3 years ago

Yes. There a a bunch of API functions like message_popup_get_popup_notifications, message_popup_get_unread_popup_notification_count, and other such webservices to mark notifications as read etc.

agrawal-d commented 3 years ago

Yep, you can take a look at the implementation of APIs to sync read state between a client and the server here: https://github.com/agrawal-d/moodle-cms-notifs/blob/main/src/api.rs ( this one marks all as read )