cseitz / SoftwareEngineering-Team-TGMGPA

"There Goes My GPA"
MIT License
5 stars 1 forks source link

Push Notifications #12

Open cseitz opened 3 years ago

cseitz commented 3 years ago

Use the Push Notifications API to be able to send notifications about tasks.

Please make this object-oriented if possible.

cseitz commented 3 years ago

This task is on hold due to the requirement of a secure context in order to use the Push Notifications API.

wesaka commented 3 years ago

The notifications we want to show are primarily related to the due dates, right?

How I am thinking in implementing this is, adding a field in the task creation modal that says "Notify me in:" and the options would be a set date and time, and fixed periods of time before the due date of the task, and final notification when a task goes overdue.

Also for the content of the notification, should I just use the task title to send the notification?

cseitz commented 3 years ago

Yeah that sounds good. Yep just use the content of the notification as the title. Include the description if possible, if it exists on the task. Notifications should have a title, description, and link field. Clicking the notification should open up our app.

wesaka commented 3 years ago

The notification itself is already looking good and working correctly. The only thing that I can't seem to figure out, is how to set up a notification to be shown at a set time. I read a few dozen articles, questions, and tutorials alike on the subject, and they all converge to a single solution: service workers. I have successfully defined the code for the service worker to be installed and registered in the browser, but the thing I can't figure out is how to use it to call the notification. @cseitz do you happen to know something about service workers to help me out here?

wesaka commented 3 years ago

Oh, important detail I left out: the issue I am having difficulty getting done is to show a notification while the user is offline, with the app closed. It should be possible, but I don't know how, yet.

cseitz commented 3 years ago

We should look into progressive web app support for the taskbook. That would resolve the issue and could be a nifty feature as well.

wesaka commented 3 years ago

Have been working these last few days on this, but I am starting to question if it is worth it. I have read all the materials I could find on the web about service workers and push notifications, and everything I try to implement just doesn't work. I mean, it for sure can work, eventually, but I don't know if for our project it is worth spending so much time on a single issue.

Thinking on this, I thought of something that could work, but it involves using a server for just the notifications, some online resources talk about that, but I feel it would be overkill for our application, well, that is only my opinion. @NolSpencer @cseitz if you guys want to make the push notifications work even if the user isn't with our application open, I can continue working on that and will make it work, but can't guarantee when.

wesaka commented 3 years ago

This last commit is about "polishing" the working version of the push notifications, to properly set the rudimentary polling system I have put in place and other miscellaneous little improvements in the code.

Edit: Just want to let this out of my chest: working with python in web dev just feels wrong. It for sure isn't optimized for this.