There are two types of push notifications supported.
Browsers that support Navigator.permissions and are supported by Firebase Messaging.
Notifications need the notifications feature, and My Schedule reminders also need mySchedule (Features). Both are on by default.
A few minutes before a sessions starts, attendees can get reminder notifications. These are sent automatically by schedule-notifications.ts. When the session has a stream link, the reminder has a Watch live button that opens it, where the browser shows notification buttons (verify on iOS). See Content model for stream links. After changing event.attendance, event.stream or the tracks' stream, deploy the functions again.
Session times are read in the event time zone, event.timezone in site.json. The functions copy it at build time, so deploy the functions again after changing it. The optional icon in the Firestore config/notifications document sets the notification icon.
To get a notification an attendee has to:
- Be authenticated
- Have enabled "My Schedule notifications"
- Have saved the session that is about to start
General notifications are sent to everyone (authenticated and anonymous) who has enabled "General notifications". These are sent manually by conference organizers.
To send a "General notification" from the command line:
FIRESTORE_TARGET=production ./hb notify --title "Doors open" --body "Registration is in the main hall." --path /schedule
--path is the page the notification opens, or a full https:// link. --icon replaces the icon from config/notifications. It asks before sending from production, and --yes sends without asking. Without FIRESTORE_TARGET=production, it adds the notification to the emulator, where npm start runs the function. It needs the notifications and functions features, since the sendGeneralNotification function sends it.
To send one from the Firebase console instead:
- Got to the project's Firestore page
- "Start collection" with the ID
notifications - On the document creation page enter the following three fields
title:Announcing GDG DevFest Ukraine 2017body:It is official. GDG DevFest Ukraine 2017 is going to take place in Lviv, on October 13-14.path:/blog/dfua17-announced
- Save