Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

120
Visualizações
How to implement Firebase Cloud messaging in Webapp using native javascript

I am trying to integrate latest version of firebase cloud messaging in web application using native javascript. From documentation it look like they have moved to node js approach and i am unable to find any sample code for javascript in firebase web version 9.

i have tried to add below code in JSP file to make it run :

<script type="module">
    import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js'

    // If you enabled Analytics in your project, add the Firebase SDK for Google Analytics
    import { analytics } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-analytics.js'

    // Add Firebase products that you want to use
    import { auth } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-auth.js'
    import { firestore } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-firestore.js'
  </script>

but its throwing error "Uncaught ReferenceError: initializeApp is not defined".

even when i tried to add it to script file as below

  <script type="text/javascript" src="https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js"></script>

its throwing the same error.

I am unable to understand firebase cloud messaging integration with native JavaScript in web version 9. all code look like node js code with import statement.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda