JournalBook icon indicating copy to clipboard operation
JournalBook copied to clipboard

Daily reminder to write in the journal

Open gnapse opened this issue 6 years ago • 1 comments

I was thinking that maybe the notifications API could be used to allow users to setup the app to remind them daily to write if they haven't.

This would be 100% opt-in in the settings, after which the app will request for permission to notify. I haven't used the notifications API myself yet, but I'd be more than happy to take a stab at it if it sounds useful.

gnapse avatar Jan 03 '19 00:01 gnapse

Great idea! That would be a lovely feature - agreed that it should be 100% opt-in from the settings area.

I also know very little about web push, but I do know we'll need a push service to ping the browser once a day. That time should be chosen (and updatable) by the user. As there's no real server involved in this project, there won't be a server-side way of knowing whether a user has written anything today. So a push will need to be sent regardless everyday, and then the client will have to check IDB (not totally sure if that's possible in a ServiceWorker, nor how we add to the Preact-generated SW file!) to see if the user has written anything.

So there's definitely some complexities to it, but if you're up for helping, that would be epic 🤓

The three pain points will probably be:

  • Subscribing and updating a push service - will we need to build this, or is there something out there already?
  • Checking IDB within a SW
  • Blocking a notification if the user has already written

So maybe it's worthwhile prototyping something to see if both are possible before we go too far down the line? How does that sound?

trys avatar Jan 03 '19 08:01 trys