Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome: DOMException: Registration failed - manifest empty or missing

I am trying to implement Push Notifications on my website (using Pushpad). Therefore I created a "manifest.json" with following content:

{
    "gcm_sender_id": "my_gcm_sender_id",
    "gcm_user_visible_only": true
}

of course I created a valid GCM-Account and have a sender id

I put the manifest.json into my root directory and I also added this line to my index.php:

<link rel="manifest" href="/manifest.json">

Using Firefox everything works fine and I can send and receive push notifications (so I think the manifest-include works fine), but Chrome won't work...

The console shows following error:

Uncaught (in promise) DOMException: Registration failed - manifest empty or missing

I searched Google for a long time and tried everything I found, but nothing works.

What I tried:

  1. created the manifest.json with "Editor" and saved it as type All Types (so no hidden .txt-file) and also with UTF-8-Encoding.
  2. restarted Chrome
  3. cleared Chrome's cache, history, etc.

I really hope somebody can help me.

like image 888
Fabian H. Avatar asked May 19 '16 21:05

Fabian H.


2 Answers

For me it was a redirect. The manifest.json must return a 200 status code (must be directly available from the server), without any redirects. You can check the response via

wget --max-redirect=0 https://example.com/manifest.json

or

curl https://example.com/manifest.json

like image 103
Sudhanshu Avatar answered Oct 21 '22 01:10

Sudhanshu


I faced same issue,added manifest file right after head tag . which worked for me.Cheers!

like image 33
Shreekanta Avatar answered Oct 21 '22 02:10

Shreekanta