nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.32k stars 3.89k forks source link

Push notifications not working in webview #6420

Open Virius opened 6 years ago

Virius commented 6 years ago

Hi.

I have problems with push notifications for some sites which using it if open them (sites) in webview. If sites opened in nw.js without webview all working fine.

NWJS Version : 0.26.6 Operating System : Windows 10, MacOS 10.12

Expected behavior

push notification is shown

Actual behavior

push notification is not shown

How to reproduce

package.json

{
  "name": "test",
  "main": "index.html",
  "version": "1.0.1",
  "chromium-args": "--enable-gcm"
}

index.html

<body>
  <webview id="webview" partition="persist:test" src="https://facebook.com"></webview>
</body>

It is assumed that notifications are switch on inside facebook (here).

If open facebook.com without webview, all work fine, i.e. package.json:

{
  "name": "test",
  "main": "https://facebook.com",
  "version": "1.0.1",
  "chromium-args": "--enable-gcm"
}

Why?

P.S. I check this problem on v0.27.5 but get error in dev console of webview:

ErrorUtils caught an error: "Failed to register a ServiceWorker: IPC connection was closed or IPC error ha...". Subsequent errors won't be logged; see https://fburl.com/debugjs. H @ s7-5se_RG_J.js:51

and serviceWorker of website in that case was not created

Christywl commented 6 years ago

I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.28.0.

Virius commented 6 years ago

any updates on this issue?