-
Notifications
You must be signed in to change notification settings - Fork 12
FEATURE: Add banner prompt for user consent #14
FEATURE: Add banner prompt for user consent #14
Conversation
Screenshots? |
When I click on the banner there is a post to the rails backend:
But I never get the confirmation notification. Tested on latest stable Chrome and nightly Firefox on Android. |
Oh dear, another case of the "it works on my machine"s -- I'll try and track this down, thanks for the feedback! |
I'm able to reproduce your issue by changing the subscription back to "ask" and refreshing the page, and toggling the notifications back and forth again, but I get a Logging out and back in seems to resolve it for me - I'll document that in another ticket though. If that was what was preventing the notification, it's unrelated to this. |
@@ -0,0 +1 @@ | |||
{{push-notification-consent}} |
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.
Is there an opportunity to re-use {{discourse-banner}}
instead?
} | ||
|
||
begin | ||
response = Webpush.payload_send( |
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 we should extract the common code in Pusher
into a method for this method to call.
Alright, I'll fix this up and apply the reviews on this one when I've got some time! |
a9819af
to
dfef2a6
Compare
This PR is back in working order. A few notes: After looking into it, I am planning to re-style the banner to support the same look+feel as the other notification before I merge this. |
Add confirmation notification once a user subscribes Do not display banner when permission is denied Disable button when notification permission is denied re-use CSS from alert classes consider the banner dismissed if the user interacts with it at all: Stops some nagging if the user enabled then disabled notifications.
cffbddb
to
c312507
Compare
Add an option to prompt a banner for a user's consent on the main screen (off by default).
Most of the work here was inspired by the way slack handles notifications, by having a predominant prompt without nagging about it.