How To Send Push Notifications With JavaScript?

  Рет қаралды 48,016

Piyush Garg

Piyush Garg

Күн бұрын

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

Пікірлер: 101
@rahulagrawal10
@rahulagrawal10 8 ай бұрын
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 2 жыл бұрын
Tnx bro,i was looking for this from past 2 monthes,but didnt find exact expected result,really really tnx brother
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Your Welcome Bro 👍
@office-jayukani
@office-jayukani 2 жыл бұрын
Thanks for the video 👍, It is working fine in my react app
@RamB-p3q
@RamB-p3q Жыл бұрын
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
@afzalguru643
@afzalguru643 5 күн бұрын
Very Helpful video brother
@sayantabhattacharjee9808
@sayantabhattacharjee9808 Жыл бұрын
8:56 localhost:3000 wants to know your location🤣🤣
@a_13_balaji_k44
@a_13_balaji_k44 4 ай бұрын
Thank you so much , this video works for me , without errors.
@ajayjb8727
@ajayjb8727 2 жыл бұрын
Thank you, awesome video, I was having trouble with creating firebase-messaging-sw.js file in public folder, finally solved it.
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Nice work!
@ajayjb8727
@ajayjb8727 2 жыл бұрын
@@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.
@AmmadAhmed-ou9bp
@AmmadAhmed-ou9bp 9 ай бұрын
Helpful! I recommend you guys to follow his tutorial if you doing this task,
@MuhammadAyaz-gp7xd
@MuhammadAyaz-gp7xd Жыл бұрын
Love you brother. Keep the good work up.
@MuhammadUmar-w8g8q
@MuhammadUmar-w8g8q Жыл бұрын
very helpful video . appreciated...
@sunnyy6295
@sunnyy6295 Жыл бұрын
can i use this in electronjs project as well?
@sagarghosh123
@sagarghosh123 Жыл бұрын
It's not possible using wordpress website we can connect with Firebase for push notification. Please assist.
@MaheshGitte-sp2zi
@MaheshGitte-sp2zi 5 ай бұрын
I create using node.js & react but problem is eatch notification shows 2 times
@tarunjha3242
@tarunjha3242 4 ай бұрын
maybe react is in the strict mode change it to the normal mode and try again
@chandreshsolanki7580
@chandreshsolanki7580 2 ай бұрын
Can you please give me the code for react and node
@tarunjha3242
@tarunjha3242 2 ай бұрын
@@chandreshsolanki7580 sorry can't gave the code because i implemented that code in company projects
@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
@shubhanshusahu7406
@shubhanshusahu7406 2 жыл бұрын
underrated video
@shitalchavan5538
@shitalchavan5538 Жыл бұрын
Can anyone tell me how to read notification sent in the browser. What is the use of onMessage method in firebase
@rajeshchitikela5847
@rajeshchitikela5847 2 жыл бұрын
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?
@DEVILGAMING-tj1ee
@DEVILGAMING-tj1ee Жыл бұрын
Dom elements are not accessible in this file can you help me out with this? Sir!
@umershabir7045
@umershabir7045 Жыл бұрын
amazing! video, but as per the test message it's working but when I sent notification it didn't showed up
@vaniavenegas3925
@vaniavenegas3925 Жыл бұрын
me pasa lo mismo u.u
@intelligentperson2447
@intelligentperson2447 Жыл бұрын
will this notification work even after the tab is closed? In background
@gracemathew61
@gracemathew61 Жыл бұрын
Benjamin thanks man i was so done with this you saved me , praise the lord maybe break some laws
@mausoofnawazish134
@mausoofnawazish134 Жыл бұрын
thanks bro, But what you actually did on the chrome permission settings? from that it's not comming like a notification.
@timetopass23
@timetopass23 9 ай бұрын
How can i set Foreground notifications? Means website open in active tab i need that time also notifications
@CHIRAGARORA-gj4cr
@CHIRAGARORA-gj4cr Жыл бұрын
very nice video
@mbh604
@mbh604 3 ай бұрын
thank you so much
@Adnanmegzel
@Adnanmegzel Жыл бұрын
best tutorial
@mohammedtaha3217
@mohammedtaha3217 Жыл бұрын
Lovely Video
@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?
@buntyswain
@buntyswain Жыл бұрын
Push notification comes but it is showing localhost:3000,how to change this?
@manojpoojary
@manojpoojary Жыл бұрын
Thank you sir
@jairoandresguevarajulio571
@jairoandresguevarajulio571 Жыл бұрын
Thanks for the video, great job
@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 Жыл бұрын
"web dev simplified" did a turorial on what you want to acheive .(on youtube)
@zinx6809
@zinx6809 Жыл бұрын
​@@riiadada5283 thanks
@pratikgosavi7341
@pratikgosavi7341 7 ай бұрын
does it work on ios also?
@pushpajitbiswas3752
@pushpajitbiswas3752 2 жыл бұрын
I'm not getting any notification, can you please help me. I did everything that showed in the video
@himankgaming7555
@himankgaming7555 4 ай бұрын
how to hide api keys in firebse service worker?
@Codebyakshay
@Codebyakshay 6 ай бұрын
ia ma getting this error care to explaing ? ERROR Registration failed - push service error ERROR Registration failed - push service error
@Anythiny
@Anythiny Жыл бұрын
add one more video to this playlist on firebase hosting
@actiongamerz1643
@actiongamerz1643 2 жыл бұрын
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.
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Have you made firebase-message-sw file?
@flutterdart4542
@flutterdart4542 Жыл бұрын
did you got any solution?
@zanhbenz
@zanhbenz Жыл бұрын
unhandledRejection: FirebaseError: Messaging: This browser doesn't support the API's required to use the Firebase SDK
@weekendplayer442
@weekendplayer442 Жыл бұрын
got the same error. Using next js
@Anjalisinghattri
@Anjalisinghattri 10 ай бұрын
Hey, any solution?
@Anjalisinghattri
@Anjalisinghattri 10 ай бұрын
M also using nextjs
@krcpr007
@krcpr007 2 жыл бұрын
what if a user is using your application with multiple device then how token will work ?
@piyushgargdev
@piyushgargdev 2 жыл бұрын
You need to store all the tokens as an array in your database. Each token is unique to device.
@christmbuli5438
@christmbuli5438 3 ай бұрын
Merci énormément !
@vivekknShots
@vivekknShots 2 жыл бұрын
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
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Can you paste your firebase config
@muneeburrehman7761
@muneeburrehman7761 9 ай бұрын
Very disappointing video, I came here to see how you have implemented this for the foreground notifications but you didn't show that
@AbdulKadir-sq4mf
@AbdulKadir-sq4mf 5 ай бұрын
Very good vedio
@Chawan-dog-kennal
@Chawan-dog-kennal 8 ай бұрын
Bhai simple JavaScript app or PWA app may kashe kre
@victorferreira2742
@victorferreira2742 Жыл бұрын
does it work for iOS?
@imtiyaz9331
@imtiyaz9331 Жыл бұрын
Sir How to send push notification to multiple devices
@princerajput6709
@princerajput6709 Жыл бұрын
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
@sonalarya5541
@sonalarya5541 2 жыл бұрын
Hello, I receiving the error importScript not found why this happening I did everything correctly..?
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Don't worry, the code would still work fine. That's just an error from your IDE, not the actual error in your code.
@simba6510
@simba6510 2 жыл бұрын
thanks bro, this video helped me so much.
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Glad to hear it!
@shivamkumartripathi3052
@shivamkumartripathi3052 Жыл бұрын
How to send notification in safari browser because it is not working in safari
@AnibalGutierrezYoSoy
@AnibalGutierrezYoSoy 2 жыл бұрын
Hola! se puede enviar la notificacion directamente desde la app en modo admin?
@SanjayNG125
@SanjayNG125 Жыл бұрын
How to hide our firebase details...??
@mawaisnabeel
@mawaisnabeel Жыл бұрын
ya jo code end pa video skip kr k add kia ha kahan sy kia ha
@pulkitjain5159
@pulkitjain5159 Жыл бұрын
doing every thing right still it's not working at all
@roshankumar-um9he
@roshankumar-um9he 2 жыл бұрын
how to give permission when we send data? i didn't get notification
@gouthamasatheesh
@gouthamasatheesh 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
You have to use the getApps package to see if there are any existing apps instantiated.
@axioluxe
@axioluxe 2 жыл бұрын
i have followed but not work
@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 2 жыл бұрын
facing issue in version 9.15.0 bro
@weekendplayer442
@weekendplayer442 Жыл бұрын
export const app = initializeApp(firebaseConfig); export const messaging = getMessaging(app); Server Error ReferenceError: navigator is not definedI
@Ediflex2
@Ediflex2 Жыл бұрын
Website mein kaise lagaye
@sandeep_jadaun
@sandeep_jadaun 2 ай бұрын
Hlw sir ek help chahiye
@IlhamYusron-t6o
@IlhamYusron-t6o Жыл бұрын
hi, how to fix duplicate notifications?
@davydavydavy05
@davydavydavy05 Жыл бұрын
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 .
@ShrinjoySaha-c4z
@ShrinjoySaha-c4z Жыл бұрын
Not receiving notifications
@geovajonnathacorreia559
@geovajonnathacorreia559 Жыл бұрын
why do you need initialize firebase in two files ?
@enongenegilian9367
@enongenegilian9367 2 жыл бұрын
why do you speak in your dialet?
@piyushgargdev
@piyushgargdev 2 жыл бұрын
Hi There, I feel more comfortable in speaking in Hindi, so thats why :)
@jaif2900
@jaif2900 2 жыл бұрын
Wrong video doesn't works
How To Send Push Notifications With JavaScript
11:38
Web Dev Simplified
Рет қаралды 364 М.
Версия без цензуры в 🛒 МИРАКЛЯНДИЯ
00:47
Непосредственно Каха - бургер
00:27
К-Media
Рет қаралды 3,2 МЛН
Don’t try this trick with a Squid Game Soldier 😉 #squidgame
00:15
Andrey Grechka
Рет қаралды 179 МЛН
How to Learn to Code FAST (Do This or Keep Struggling)
11:00
Andy Sterkowitz
Рет қаралды 728 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 78 МЛН
Push Notifications with Service worker
14:15
Akilesh Rao
Рет қаралды 39 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 268 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 974 М.
What are Message Queues? | BullMQ Queues NodeJS
44:12
Piyush Garg
Рет қаралды 44 М.
WebSocket in NodeJS | Socket.IO - Real Time Messaging
32:27
Piyush Garg
Рет қаралды 238 М.
Push Notifications Using Node.js & Service Worker
29:52
Traversy Media
Рет қаралды 285 М.
Версия без цензуры в 🛒 МИРАКЛЯНДИЯ
00:47