w3c / push-api

Push API
https://w3c.github.io/push-api/
Other
145 stars 40 forks source link

Question: Budget with Permission #263

Closed Jxck closed 7 years ago

Jxck commented 7 years ago

Web Pus Notification asks user to Allow/Deny of Permission with popup. If Denied, Service can't send Notification.

in this case, will silent-push (without notification) success if budget for silent push are available ?

(in other word, Permission for Push Notification will only block a Notification ? or also effects to silent-push even if budget are available ?)

martinthomson commented 7 years ago

It's important to understand the distinction between what the specifications say and what implementations do here.

The specs require that you have permission for push. That is logically separate from permission for notifications. The permissions API recognizes these as separate permissions.

That said, implementations all (?) grant and deny permission for push and notifications together. That is, requesting permissions for one grants or denies both at the same time.

That means that if a user rejects a notification permission, then a push subscription cannot be created either. Whether the site then has budget becomes immaterial, it can't generate notifications or pushes.

Jxck commented 7 years ago

my understand is, Permission for Push and Notification are separated in spec, but, for example Chrome UI for Permission are Merged for Both.

in that case, I have more Question

  1. install 'silent-push' will ask user a permission for Push ? or 'silent-push' will only controlled by budget ?
  2. if Yes for 1, and if denied, Notification will blocks too ? (in chrome)
martinthomson commented 7 years ago

That's a question for implementations. My understanding is that because notification and push permissions are linked, subscribing for a silent push will show the notifications permissions dialog. If that request is blocked, notifications will be blocked.

Jxck commented 7 years ago

OK, It seems better to separate Push / Notification for Permission in UI Implementation, but I'll ask more about it at implementation threads. Thanks so much !