How To Send Push Notifications With JavaScript?

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • Hey everyone, I am Piyush Garg and in this video, we are going to learn how we can send push notifications to a user via browser using React and Firebase cloud messaging.
    ► Complete Code Link: drive.google.c...
    Quick Links
    ► Firebase Console: firebase.googl...
    ► Firebase Docs: firebase.googl...
    ► Firebase Cloud Messing Docs: firebase.googl...
    Featured Playlists
    ► Complete Java Tutorial Series - • Java Tutorial Series i...
    ► Complete ReactJS Tutorial Series - • Complete React Tutoria...
    ► Complete Firebase & React Tutorial Series - • Firebase with Reactjs ...
    ► Website - piyushgarg.dev
    Social Links
    ► Instagram - / piyushgarg_dev
    ► Facebook - / piyushgarg.dev
    ► LinkedIn - / piyushgarg195
    ► Telegram Channel Link t.me/codewithp...
    Video Titles
    How to send push notifications using javascript?
    How to send push notifications using React?
    How to send notifications in chrome?
    How to use firebase cloud messaging in react?
    How to use firebase cloud messaging?
    Tags
    - React
    - Firebase
    - Firebase Cloud Messaging
    Hashtags
    #reactjs #reactjsdeveloper #firebase #firebasecloud #javascript #serviceworker

Комментарии • 93

  • @rahulagrawal10
    @rahulagrawal10 3 месяца назад +2

    Hey Piyush, I used to be addictive to your videos now and for mostly all the topics on which I want to learn something, I search for your video. Thank you so much for your great efforts.

  • @zaynsaifi5331
    @zaynsaifi5331 Год назад +1

    Tnx bro,i was looking for this from past 2 monthes,but didnt find exact expected result,really really tnx brother

  • @office-jayukani
    @office-jayukani Год назад +4

    Thanks for the video 👍,
    It is working fine in my react app

  • @user-dr7rw2kl4u
    @user-dr7rw2kl4u 10 месяцев назад

    Thanks for this amazing video, I checked many videos for push notification but that one is not working but your video is very impressive, your description is very good

  • @AmmadAhmed-ou9bp
    @AmmadAhmed-ou9bp 4 месяца назад

    Helpful! I recommend you guys to follow his tutorial if you doing this task,

  • @sayantabhattacharjee9808
    @sayantabhattacharjee9808 Год назад +2

    8:56 localhost:3000 wants to know your location🤣🤣

  • @ajayjb8727
    @ajayjb8727 Год назад +3

    Thank you, awesome video, I was having trouble with creating firebase-messaging-sw.js file in public folder, finally solved it.

    • @piyushgargdev
      @piyushgargdev  Год назад +1

      Nice work!

    • @ajayjb8727
      @ajayjb8727 Год назад

      @@piyushgargdev In Firebase docs they have mentioned you can add meaningful content. Even after Googling also can't able to find right solution. I still don't understand why firebase has made it so complicated.

  • @user-rh9sl1ww9k
    @user-rh9sl1ww9k Год назад +2

    very helpful video . appreciated...

  • @gracemathew61
    @gracemathew61 11 месяцев назад

    Benjamin thanks man i was so done with this you saved me , praise the lord maybe break some laws

  • @sagarghosh123
    @sagarghosh123 Год назад +1

    It's not possible using wordpress website we can connect with Firebase for push notification. Please assist.

  • @MuhammadAyaz-gp7xd
    @MuhammadAyaz-gp7xd Год назад +1

    Love you brother. Keep the good work up.

  • @shitalchavan5538
    @shitalchavan5538 Год назад +1

    Can anyone tell me how to read notification sent in the browser. What is the use of onMessage method in firebase

  • @rajeshchitikela5847
    @rajeshchitikela5847 Год назад +1

    In Android I am just getting notification and it is sitting in the notification tray, how would I be able to make it as a floating notification?

  • @MaheshGitte-sp2zi
    @MaheshGitte-sp2zi 5 дней назад

    I create using node.js & react but problem is eatch notification shows 2 times

  • @CHIRAGARORA-gj4cr
    @CHIRAGARORA-gj4cr Год назад +1

    very nice video

  • @ritankarbhattacharjee7661
    @ritankarbhattacharjee7661 Год назад

    The video is absolutely great Piyush. But I don't what is the cause when I placed the service worker in public folder it did not work but when I moved it in src folder it started working also changed the import codes a bit

  • @umershabir7045
    @umershabir7045 Год назад +1

    amazing! video, but as per the test message it's working but when I sent notification it didn't showed up

  • @zanhbenz
    @zanhbenz Год назад +2

    unhandledRejection: FirebaseError: Messaging: This browser doesn't support the API's required to use the Firebase SDK

  • @sunnyy6295
    @sunnyy6295 9 месяцев назад +1

    can i use this in electronjs project as well?

  • @timetopass23
    @timetopass23 4 месяца назад

    How can i set Foreground notifications?
    Means website open in active tab i need that time also notifications

  • @manojpoojary
    @manojpoojary 7 месяцев назад

    Thank you sir

  • @shubhanshusahu7406
    @shubhanshusahu7406 Год назад

    underrated video

  • @mohammedtaha3217
    @mohammedtaha3217 Год назад

    Lovely Video

  • @user-ul6qv3qw1d
    @user-ul6qv3qw1d Год назад

    best tutorial

  • @mausoofnawazish134
    @mausoofnawazish134 Год назад

    thanks bro, But what you actually did on the chrome permission settings? from that it's not comming like a notification.

  • @intelligentperson2447
    @intelligentperson2447 7 месяцев назад

    will this notification work even after the tab is closed?
    In background

  • @DEVILGAMING-tj1ee
    @DEVILGAMING-tj1ee 6 месяцев назад

    Dom elements are not accessible in this file can you help me out with this? Sir!

  • @techknowledgebase4504
    @techknowledgebase4504 Год назад

    HI, v10.2.0 with sw Nextjs not working windows 10 but same setup working in MacOS. Are you know how to solve that?

  • @f4kshort633
    @f4kshort633 Год назад +2

    Bhai mobile main notification send nahi kar raha hai please help

  • @Anythiny
    @Anythiny 9 месяцев назад

    add one more video to this playlist on firebase hosting

  • @Codebyakshay
    @Codebyakshay Месяц назад

    ia ma getting this error care to explaing ?
    ERROR
    Registration failed - push service error
    ERROR
    Registration failed - push service error

  • @pushpajitbiswas3752
    @pushpajitbiswas3752 Год назад

    I'm not getting any notification, can you please help me. I did everything that showed in the video

  • @saqibhussain2843
    @saqibhussain2843 Год назад

    great.
    but how can we send push notification programmatically I mean when a user click a button(reactjs,html etc) it should triggered a notification

    • @riiadada5283
      @riiadada5283 Год назад +2

      "web dev simplified" did a turorial on what you want to acheive .(on youtube)

    • @zinx6809
      @zinx6809 Год назад

      ​@@riiadada5283 thanks

  • @weekendplayer442
    @weekendplayer442 9 месяцев назад

    export const app = initializeApp(firebaseConfig);
    export const messaging = getMessaging(app);
    Server Error
    ReferenceError: navigator is not definedI

  • @Chawan-dog-kennal
    @Chawan-dog-kennal 3 месяца назад

    Bhai simple JavaScript app or PWA app may kashe kre

  • @buntyswain
    @buntyswain 8 месяцев назад

    Push notification comes but it is showing localhost:3000,how to change this?

  • @pratikgosavi7341
    @pratikgosavi7341 2 месяца назад

    does it work on ios also?

  • @AnibalGutierrezYoSoy
    @AnibalGutierrezYoSoy Год назад

    Hola! se puede enviar la notificacion directamente desde la app en modo admin?

  • @simba6510
    @simba6510 Год назад

    thanks bro, this video helped me so much.

  • @imtiyaz9331
    @imtiyaz9331 10 месяцев назад

    Sir How to send push notification to multiple devices

  • @vivekknShots
    @vivekknShots Год назад

    provider.ts:122 Uncaught FirebaseError: Messaging: Missing App configuration value: "projectId" (messaging/missing-app-config-values). i ma getting this error i have already added the project id in the firebaseConfig still getting that error

  • @krcpr007
    @krcpr007 Год назад

    what if a user is using your application with multiple device then how token will work ?

    • @piyushgargdev
      @piyushgargdev  Год назад +1

      You need to store all the tokens as an array in your database. Each token is unique to device.

  • @shivamkumartripathi3052
    @shivamkumartripathi3052 Год назад

    How to send notification in safari browser because it is not working in safari

  • @sonalarya5541
    @sonalarya5541 Год назад

    Hello, I receiving the error importScript not found why this happening I did everything correctly..?

    • @piyushgargdev
      @piyushgargdev  Год назад

      Don't worry, the code would still work fine. That's just an error from your IDE, not the actual error in your code.

  • @SanjayNG125
    @SanjayNG125 8 месяцев назад

    How to hide our firebase details...??

  • @jairoandresguevarajulio571
    @jairoandresguevarajulio571 Год назад

    Thanks for the video, great job

  • @pulkitjain5159
    @pulkitjain5159 Год назад

    doing every thing right still it's not working at all

  • @sagargunjal1590
    @sagargunjal1590 Год назад

    I got two notifications instead of one after sending it from fcm

    • @MaheshGitte-sp2zi
      @MaheshGitte-sp2zi 5 дней назад

      Hi bro you solved this let me know, i have same problem

  • @roshankumar-um9he
    @roshankumar-um9he Год назад

    how to give permission when we send data?
    i didn't get notification

  • @roshankumar-um9he
    @roshankumar-um9he Год назад

    facing issue in version 9.15.0 bro

  • @victorferreira2742
    @victorferreira2742 11 месяцев назад

    does it work for iOS?

  • @user-pt3oi4wp7w
    @user-pt3oi4wp7w 7 месяцев назад

    Not receiving notifications

  • @mawaisnabeel
    @mawaisnabeel Год назад

    ya jo code end pa video skip kr k add kia ha kahan sy kia ha

  • @princerajput6709
    @princerajput6709 9 месяцев назад

    hey piyush i am getting same notification twice can u please help me?

    • @MaheshGitte-sp2zi
      @MaheshGitte-sp2zi 5 дней назад

      I have same problem, of you have solution let me know

  • @Amit91461
    @Amit91461 10 месяцев назад

    Website mein kaise lagaye

  • @axioluxe
    @axioluxe Год назад

    i have followed but not work

  • @user-hx1sg7ey6x
    @user-hx1sg7ey6x Год назад

    hi, how to fix duplicate notifications?

    • @trapz3666
      @trapz3666 Год назад

      hey did you find the solution?

    • @ThanHtutZaw3
      @ThanHtutZaw3 Год назад

      Just temporally remove code self.registration.showNotification in service worker . It sends duplicate because we are sending from our app and also from the firebase console .

  • @actiongamerz1643
    @actiongamerz1643 Год назад

    sir aapki jo 11:50 per error aati hai wo meri bhi same aa rahi hai but aapki solve hoo gai meri nahi ho rahi hai, Please Help.

  • @geovajonnathacorreia559
    @geovajonnathacorreia559 Год назад

    why do you need initialize firebase in two files ?

  • @enongenegilian9367
    @enongenegilian9367 Год назад

    why do you speak in your dialet?

    • @piyushgargdev
      @piyushgargdev  Год назад

      Hi There, I feel more comfortable in speaking in Hindi, so thats why :)

  • @muneeburrehman7761
    @muneeburrehman7761 3 месяца назад +1

    Very disappointing video, I came here to see how you have implemented this for the foreground notifications but you didn't show that

  • @jaif2900
    @jaif2900 Год назад

    Wrong video doesn't works

  • @gouthamasatheesh
    @gouthamasatheesh Год назад

    I followed the same thing in Next JS. But I got some errors.
    utils/firebase.js (18:38) @ eval
    TypeError: (0 , firebase_messaging__WEBPACK_IMPORTED_MODULE_1__.getMessaging) is not a function
    FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
    These are the errors, I have got. Can you please help me to resolve this?

    • @piyushgargdev
      @piyushgargdev  Год назад

      It seems like you are trying to create a file with name that is conflicting with some package. Can you share your code please?

    • @optymystyc
      @optymystyc Год назад

      You have to use the getApps package to see if there are any existing apps instantiated.

  • @abdullaharz5945
    @abdullaharz5945 8 месяцев назад

    Such a helpful Video Thanks