-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push Notifications #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for doing this!
I'm looking forward to hearing your take on potentially removing notify
from user.dart; afterwards, I think we're good to merge!
firebase.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this file contains our private keys Edit: turns out I was mistaken: it looks to have the appId
in common with credentials.dart but fortunately not the API keys (and even then, based on firebase/flutterfire#7617 we're perhaps already being a bit overzealous with our use of the private submodule 🤷)
@@ -6,6 +8,7 @@ class SettingsScreen extends StatelessWidget { | |||
|
|||
@override | |||
Widget build(BuildContext context) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(pretty sure the auto-formatter would remove this line)
@@ -77,6 +83,7 @@ sealed class ThcUser { | |||
final String? id; | |||
final String? email; | |||
final bool registered; | |||
final bool? notify; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storing a bool?
value is a smart move 👍
@@ -41,7 +41,8 @@ enum LocalStorage { | |||
themeMode, | |||
navBarSelection, | |||
adminWatchLive, | |||
adminStream; | |||
adminStream, | |||
notify; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes a lot of sense for stuff like display & notification settings to be saved in local storage.
With that in mind, I wonder if we could get rid of the class member in user.dart and make it work just using the LocalStorage.notify()
value 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After glancing at the message from the most recent commit, it looks like there's a decently good reason for the setup being the way it is.
I think we're good to land this one, after 1 very important change…
Enables push notifications for upcoming livestreams that the user has signed up for.
I don’t believe there currently is a way through the app to sign up for a livestream, so for now you would have to add yourself to the
signup
sub collection underscheduled_streams
manually(screenshot)Then in the app settings, you can enable/disable notifications. (screenshot)
It’s currently set up to send a notification an hour before the livestream starts, but we can change that as needed.
There is more work that needs to be done on push notifications, but this should give us a good starting point I think.
All feedback welcome, thanks!