gdg-x / hoverboard

Conference website template
https://hoverboard-master.web.app
Other
1.11k stars 1.09k forks source link

No proper configuration document for push notifications #500

Closed pamuditha closed 2 years ago

pamuditha commented 6 years ago

@sophieH29 please look at it

pamuditha commented 6 years ago

@ozasadnyy any update

atharvaunde commented 4 years ago

@ozasadnyy any update regarding documentation?

ozasadnyy commented 4 years ago

Hey, I'm not working anymore on this project.. @abraham could you please take a look to this issue?

atharvaunde commented 4 years ago

@abraham actually I changed firebase message sender id in manifest and firebase config file but on allowing my browser to send notifications. clicking on the bail icon says we can't send you notifications.

1)Can we send push notifications from the firebase console or these notifications are triggered only from events? can u share how this works?

abraham commented 4 years ago

I haven't actually dug into how push notifications work yet. I need to test it with #579 though so I'll document what I learn :)

cortinico commented 4 years ago

1)Can we send push notifications from the firebase console or these notifications are triggered only from events? can u share how this works?

I can share my findings/experience from running hoverboard for DevFest Pisa 2019.

You basically have two types of Push Notifications that can be sent by Hoverboard.

General Notifications

Those are notifications that are sent to all of your subscribers (users that pressed "yes" to receive push notifications when they opened the website for the first time).

General notifications are sent by the sendGeneralNotification cloud function that is trigger by adding documents on /notifications/{timestamp} in firestore. You basically create a new document there with:

{
    "title": "Notification Title",
    "body": "Notification Body Message",
    "click_action": "https://<your url here>/
}

And a notification will be scheduled to all of your users.

Please note that some configuration (such as icon and timezone) is also fetched from the /config/notifications document on Firestore.

Schedule Notifications

Those are notifications that are sent only to the user that picked a specific session as "favourite" in the schedule. They're intended to be used as reminders for the upcoming session.

General notifications are sent by the scheduleNotifications cloud function that is trigger by the schedule-tick PubSub Topic.

In order for those to work, you need to deploy the content of the appengine folder on Google AppEngine. You have to schedule a Cron Job that publishes an event on the schedule-tick PubSub Topic every 5 minutes. This will trigger the cloud functions that will notify your users.

abraham commented 4 years ago

@cortinico is there anything that came up during DevFest Pisa that you found lacking in notifications? From my few minutes of thinking about notifications general announcements and schedule reminders where the two types that made sense. Just wondering if there was anything else that you would have found useful.

For scheduled notifications I'll be updating to scheduled functions at some point and will probably get rid of the appengine part.

cortinico commented 4 years ago

@abraham So far we had multiple problems with AppEngine/CloudFunctions related to timezones and string management. The result was that Schedule notification was not working at all :/ I fixed it for DevFest Pisa 2019 but I haven't had the time to clean up our implementation and send a PR.

Given that DevFest Pisa 2020 is coming really soon, I need to fix this and I'll open a PR.

For scheduled notifications I'll be updating to scheduled functions at some point and will probably get rid of the appengine part

Yeah this would be a major simplification 👍

@cortinico is there anything that came up during DevFest Pisa that you found lacking in notifications?

Not much honestly. Schedule notif. worked fine and we haven't used the general notifications during the event. So far everything was great!

abraham commented 4 years ago

Thanks for the info! I'll keep a particular eye on dates/times when I'm testing.

abraham commented 2 years ago

There is some notification docs now. https://github.com/gdg-x/hoverboard/blob/main/docs/tutorials/05-notifications.md