Skip to content
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

Merged
merged 7 commits into from
Aug 28, 2024
Merged

Push Notifications #73

merged 7 commits into from
Aug 28, 2024

Conversation

mbeargie1238
Copy link
Member

@mbeargie1238 mbeargie1238 commented Aug 27, 2024

Enables push notifications for upcoming livestreams that the user has signed up for.
20240827_133158

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 under scheduled_streams manually(screenshot)

Screenshot 2024-08-27 at 1 30 53 PM

Then in the app settings, you can enable/disable notifications. (screenshot)

Screenshot_20240827_132837

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!

@nate-thegrate
Copy link
Member

1598047401-559207-trotk

Thank you Matt!

My schedule has been quite busy as of late, but I'll be sure to review this soon!

@nate-thegrate nate-thegrate self-requested a review August 27, 2024 22:39
Copy link
Member

@nate-thegrate nate-thegrate left a 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
Copy link
Member

@nate-thegrate nate-thegrate Aug 28, 2024

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) {

Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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 🤔

Copy link
Member

@nate-thegrate nate-thegrate left a 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…

@nate-thegrate nate-thegrate merged commit 8467c45 into main Aug 28, 2024
1 check passed
@nate-thegrate nate-thegrate deleted the notifications branch August 28, 2024 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants