Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!