title: Firebase not get the token id for web app
body: <p>As per this video instruction <a href="https://www.youtube.com/watch?v=BsCBCudx58g" rel="nofollow noreferrer">https://www.youtube.com/watch?v=BsCBCudx58g</a>, I have integrated the code it looks below.</p>
  
  <pre><code>&lt;script src="https://www.gstatic.com/firebasejs/3.6.5/firebase.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
    // Initialize Firebase
    var config = {
      apiKey: "IIzaSyA3MZtKiK6E6y7q9w26J-YMi9Leeao5Zs0",
      authDomain: "a...99.firebaseapp.com",
      databaseURL: "https://a...99.firebaseio.com",
      storageBucket: "a...99.appspot.com",
      messagingSenderId: "915965251026"
    };
    firebase.initializeApp(config);
  
      const messaging = firebase.messaging();
      messaging.requestPermission()
      .then(function() {
      alert('Notification permission granted.');
  
      return messaging.getToken();
  
      }).then(function(token){
          alert(token);
      })
      .catch(function(err) {
          alert('Unable to get permission to notify.', err);
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>manifest.json file</strong></p>
  
  <pre><code>{
    "short_name": "AirHorner",
    "name": "Kinlan's AirHorner of Infamy",
  
    "start_url": "index.html?launcher=true"
  }
  </code></pre>
  
  <p>Also I have created a dummy "firebase-messaging-sw.js" file</p>
  
  <p><Br>
  <strong>What error I faced</strong>
  <br>
  When I execute it, <strong>Notification permission granted</strong> alert was executed, and suddenly display <strong>Unable to get permission to notify</strong> message and in the <strong>err</strong> argument I got the following error
  <br></p>
  
  <blockquote>
    <p>browserErrorMessage
    :
    "Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script."
    code
    :
    "messaging/failed-serviceworker-registration"
    message
    :
    "Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script. (messaging/failed-serviceworker-registration)."
    stack
    :
    "FirebaseError: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script. (messaging/failed-serviceworker-registration).↵    at <a href="https://www.gstatic.com/firebasejs/3.6.5/firebase.js:552:225" rel="nofollow noreferrer">https://www.gstatic.com/firebasejs/3.6.5/firebase.js:552:225</a>"</p>
  </blockquote>
  
  <p>In <strong>message.getToken()</strong> return the following value</p>
  
  <blockquote>
    <p>_proto__
    :
    Promise
    [[PromiseStatus]]
    :
    "pending"
    [[PromiseValue]]
    :
    undefined</p>
  </blockquote>