How To Send Push Notifications With JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ก.ค. 2024

ความคิดเห็น • 431

  • @danielegvi
    @danielegvi ปีที่แล้ว +654

    This is a great introduction to regular notifications, but these are NOT push notifications, the video title is misleading. In order to make push notifications, you must pair the Notification API with the Push API (see MDN docs) in server workers. You should update the title of the video to reflect that.

    • @porroapp
      @porroapp ปีที่แล้ว +15

      Push API isn't supported by Safari.

    • @fullstack_journey
      @fullstack_journey ปีที่แล้ว +6

      +1

    • @mohammedg485
      @mohammedg485 ปีที่แล้ว +4

      +1

    • @Wawa-nh9sq
      @Wawa-nh9sq ปีที่แล้ว +4

      +1

    • @Scuffy
      @Scuffy ปีที่แล้ว +2

      @@porroapp yea only on apps not safari which is a L

  • @ChronSyn
    @ChronSyn ปีที่แล้ว +350

    Correction: this is known as a local notification, not a push notification. They are both part of the umbrella term of notifications but have entirely different implementations.
    A push notification is triggered with data sent from a remote origin, typically an APN (iOS), GCP (Android) or via the web push API connected to a remote server. The remote data provider pushes the data to the client, hence the term 'push notification'.
    A local notification is triggered from within a web page or app, and does not rely on a remote origin to provide data. The local notification can be displayed with data retrieved from a remote source, but this is not the same as a push notification.

    • @alexdominguess
      @alexdominguess ปีที่แล้ว +6

      So the notification done in this way would work if the user is not with the page opened?

    • @petergg9096
      @petergg9096 ปีที่แล้ว +10

      @@alexdominguess no it wont

    • @Pekerjarimot
      @Pekerjarimot ปีที่แล้ว +1

      ​@@alexdominguess no

    • @kiyokodyele
      @kiyokodyele ปีที่แล้ว +7

      this is what I've been looking for the entire video. I made a push notification with node NodeJS and I could still remember that there is VAPID thing you need to be able to send push notification. I was confused when he said you can send push notification with just client-side JavaScript.

    • @ricky8466
      @ricky8466 ปีที่แล้ว +1

      thank you for the correction, if not because you, i'll misguided too

  • @chrisodillman3355
    @chrisodillman3355 ปีที่แล้ว +102

    My take away from this tutorial i just watched because it sounded interesting is: i know it exists, i know it is easy to do, i know where to find a tutorial. Thanks a lot Kyle

  • @sayatraykulov6225
    @sayatraykulov6225 ปีที่แล้ว +12

    Your tutorials are the best for me through the whole youtube. Useful information in every seconds, and nothing else.

  • @otabekkadirov2578
    @otabekkadirov2578 ปีที่แล้ว +2

    Thank you Kyle. I'm from Uzbekistan and Im learning web programming. You really simplify the web!

  • @rolitorape3020
    @rolitorape3020 ปีที่แล้ว +7

    This guy is God sent. The explanation is sooo clean

  • @ubeydeozdmr
    @ubeydeozdmr ปีที่แล้ว

    It's been great to have this video posted recently as I've been thinking about how to do this for my app. Thank you so much

  • @randomuser23493
    @randomuser23493 9 หลายเดือนก่อน

    Very useful video. Glad I'm part of your subscribed viewers Kyle. Keep it up!

  • @vugarbakhshalizade2826
    @vugarbakhshalizade2826 ปีที่แล้ว +26

    Yet another high value tutorial. Thank you!

  • @matheusmartino5738
    @matheusmartino5738 ปีที่แล้ว

    I will have to implament that next week at my job. Perfect timing. Thank you so much!

  • @zulhilmiomar1491
    @zulhilmiomar1491 ปีที่แล้ว +2

    such a high value tutorial and info! thanks kyle!

  • @luis96xd
    @luis96xd ปีที่แล้ว +2

    Amazing tutorial, the best I've seen, it was well explained and in 11 minutes, thanks 👏💯👍😄👍

  • @shahmir3565
    @shahmir3565 ปีที่แล้ว +6

    Your way Of Teaching Is Awesome ❤️

  • @bobdinitto
    @bobdinitto ปีที่แล้ว

    Very, very awesome Kyle! I've always wondered how these notifications work. Thanks!

  • @xdmemeguy
    @xdmemeguy ปีที่แล้ว +2

    I love the way you research something for a video. Now this can't be more explained than you have already done

    • @arjix8738
      @arjix8738 ปีที่แล้ว +1

      It is super easy to learn stuff about the notifications API, so it does not require much research, but the point still stands that he makes nice explanations.
      And that is all that matters. :thumbsup:

    • @xdmemeguy
      @xdmemeguy ปีที่แล้ว +1

      @@arjix8738 Thats what i said in fewer lines

    • @arjix8738
      @arjix8738 ปีที่แล้ว

      @@xdmemeguy no, you did not say that the notifications API is super easy and needs no research at all, you can literally just read the docs, there is no need for a tutorial, but I am not saying that this is a worthless video

  • @maxwellosuji4096
    @maxwellosuji4096 ปีที่แล้ว

    I’ve been thinking of additional features to my website and this helps alot thanks kyle❤️

  • @yasirtahirkheli74
    @yasirtahirkheli74 ปีที่แล้ว +42

    Too good and an excellent addition to my code arsenal. Long live mate.

    • @javierxcod
      @javierxcod ปีที่แล้ว

      @John REST IN PISS QUEEN, SMOKING ON THE ROYAL PACK 🚬🚬🚬

    • @brendon205
      @brendon205 ปีที่แล้ว +2

      @John 💀

    • @HypnosisBear
      @HypnosisBear ปีที่แล้ว +3

      @John Queen what??!! What are you on?

    • @rednexie
      @rednexie ปีที่แล้ว +2

      @John dude...

    • @farhanaditya2647
      @farhanaditya2647 ปีที่แล้ว

      @John ayo

  • @mengsreangchannel6180
    @mengsreangchannel6180 ปีที่แล้ว +1

    Thanks *Kyle* for sharing a good tutorial like this.

  • @LacMatMuaXuan
    @LacMatMuaXuan ปีที่แล้ว

    Thank you so much! Your clips are really useful for me and other people.

  • @mustafaibrahim2558
    @mustafaibrahim2558 ปีที่แล้ว

    I was looking for this video in your channel. But now i got it. Big ❤ bro.

  • @moishinetzer
    @moishinetzer ปีที่แล้ว

    Stuff like this is awesome, I think your CSS stuff is good but this is what people really want!

  • @tempaccount8256
    @tempaccount8256 ปีที่แล้ว

    This is a very good tutorial for notification. I just wanted to have this kind of feature for my project. Thanks😁

  • @blazerhm
    @blazerhm ปีที่แล้ว +1

    We need more videos like this!

  • @cbennder3877
    @cbennder3877 ปีที่แล้ว

    i looked long time for a video like this. Thank you.

  • @jobsunday833
    @jobsunday833 ปีที่แล้ว

    Thanks! I've been searching how to get it and this is brilliant :D

  • @nielslytzdk
    @nielslytzdk ปีที่แล้ว

    You make killer content 👍. Good teacher too!

  • @dimitargetsov9690
    @dimitargetsov9690 ปีที่แล้ว +1

    Even without Push API , still, CONCISE,INFORMATIVE,MEANINGFUL...GREAT!

  • @pauserratgutierrez
    @pauserratgutierrez ปีที่แล้ว

    Wow, your knowledge is amazing. Thanks for all buddy!!

  • @goldenPixele
    @goldenPixele ปีที่แล้ว +1

    Thank you man i was looking for this video

  • @mallipooalwa9085
    @mallipooalwa9085 ปีที่แล้ว

    Your the best in covering useful Javascript API's

  • @krateskim4169
    @krateskim4169 ปีที่แล้ว

    you are such a good teacher man

  • @larrydev
    @larrydev ปีที่แล้ว

    I always wondered how this worked. Thanks!

  • @charliesta.abc123
    @charliesta.abc123 ปีที่แล้ว

    Cheers for this tutorial man !

  • @ohmwai
    @ohmwai ปีที่แล้ว

    Damn. I needed this like a week ago lol. But it's still a great learning experience.

  • @thiagopintobraga6174
    @thiagopintobraga6174 ปีที่แล้ว

    Great lesson, thank for sharing this. Tomorrow I will introduce this in some systems that Im building

  • @isabelphillips451
    @isabelphillips451 ปีที่แล้ว

    Wow! Thank you so much for this video ... I learnt a lot in one video 😍😍😍

  • @AlexCernat
    @AlexCernat ปีที่แล้ว +29

    great video about notifications! but beware! notifications only, not push notifications! for push notifications you must first subscribe to push notifications on a web page / site, and then the server will send those push notifications, no matter if the browser is on that page or that page is closed; of course, after receiving a push notification you will show it to the user like the examples in this video

    • @ksrele
      @ksrele ปีที่แล้ว +1

      Do you need background workers for this to work?
      @Web Dev Simplified can you make a tutorial on workers, what they are and how to use them?

    • @DaviddeKloet
      @DaviddeKloet ปีที่แล้ว +4

      @@ksrele yes you need a service worker on the client to listen for the notifications and you need some cryptography to communicate between the server and the client.

  • @lacamoura
    @lacamoura ปีที่แล้ว

    Yooo i needed this for my project, thanks a lot

  • @TheDickname
    @TheDickname ปีที่แล้ว

    Great tutorial! You are my Hero 👍

  • @nottydread
    @nottydread ปีที่แล้ว

    Ooh, very interesting! Great tutorial.

  • @rawsmoke8148
    @rawsmoke8148 ปีที่แล้ว

    So brilliant! Thank you!

  • @hussamalhinaty2340
    @hussamalhinaty2340 ปีที่แล้ว

    Very helpful and well explained

  • @BroScro
    @BroScro ปีที่แล้ว

    thank you kyle.
    how awesome is this!

  • @loordbeerus6284
    @loordbeerus6284 ปีที่แล้ว +2

    You are awesome i love your content keep going ♥

  • @musha3368
    @musha3368 ปีที่แล้ว

    Nice! Good job bro, best tutorials!

  • @hackytech7494
    @hackytech7494 ปีที่แล้ว

    Thanks a lot for this fantastic video. Best explanation ever.

  • @guidingtechbd
    @guidingtechbd ปีที่แล้ว +1

    Awesome explanation. I owe you!! 😊

  • @sandeeptottadi
    @sandeeptottadi ปีที่แล้ว +3

    Super exciting content!

  • @beinyourguard
    @beinyourguard ปีที่แล้ว

    amazing! again, nice to see that JS is so powerful

  • @MdNaimurRahmanHera
    @MdNaimurRahmanHera ปีที่แล้ว

    Really learned some new things bro. Love you

  • @amittraspal
    @amittraspal ปีที่แล้ว +1

    Amazing Stuff, as always...... Please make one with React PWA and Web... I believe your tutorial would be so much better to wrap my head around.

  • @entrey_ua
    @entrey_ua ปีที่แล้ว

    Cool! Thank for a great tutorial.

  • @TheGeekosDen
    @TheGeekosDen ปีที่แล้ว

    I'm the guy who told you to blink your eyes a bit more when you only had like 7k subscribers. Congratulations on 1 million, also you are doing good with blinking 👁️💪

  • @jimmymedia2049
    @jimmymedia2049 ปีที่แล้ว +4

    As mentioned by @chronSyn below this is not a push notification, that requires a backend service to 'push' the notification based on some event to the browser even when you are not viewing the page. Google has a push api but most are paid and a little complex to implement.

  • @kingstalker
    @kingstalker ปีที่แล้ว

    nice didin't expect that really good well done

  • @alpha6wolf262
    @alpha6wolf262 ปีที่แล้ว

    This is amazing!

  • @slametnugroho6535
    @slametnugroho6535 ปีที่แล้ว

    wow, thank you so much, it was a big help

  • @joshuajoshua334
    @joshuajoshua334 ปีที่แล้ว

    Welldone bro. Love your tutorials. I however belive I am stuck in the tutorial hell. Been doing Front dev for a month. No job or internship yet

  • @shaikhyamin3464
    @shaikhyamin3464 ปีที่แล้ว

    I justtttt wanted to learn about push notification and you got me

  • @albertoiong6895
    @albertoiong6895 ปีที่แล้ว

    Thanks for the tutorial... As in my case of Win10, go to [Settings] -> [System] -> [Notifications and Actions] then turn on [Get notifications from apps and other senders] and everything works fine...

  • @armageddonvivas9243
    @armageddonvivas9243 ปีที่แล้ว

    ITS REALLY WORKED LOL THANK YOU DUDE

  • @nikhil6842
    @nikhil6842 ปีที่แล้ว

    Great video Kyle

  • @yusufsaify6735
    @yusufsaify6735 ปีที่แล้ว +1

    Great man 👍🏻

  • @rulesofsuccessfullife6098
    @rulesofsuccessfullife6098 5 หลายเดือนก่อน

    The video was helpful thank you for making me better than before

  • @amershboul9107
    @amershboul9107 ปีที่แล้ว

    you deserve a huge like 👍🏻👍🏻

  • @giorgosMih
    @giorgosMih ปีที่แล้ว +110

    Nice tutorial, thanks! Please do a tutorial on PWA & Web push notifications (for when the browser is closed to keep receiving notifications). They are kinda complex, but I think you will be able to explain them very clearly.

  • @ilyesbejia6566
    @ilyesbejia6566 ปีที่แล้ว

    Thanks for sharing those are great materials

  • @dclxviclan
    @dclxviclan ปีที่แล้ว

    New level knowledge, thanks bro 👍

  • @techpal9871
    @techpal9871 ปีที่แล้ว +4

    Great tutorial! Though the JS notification api isn’t fully supported on phones. It isn’t even possible on IOS as of now and chrome on android needs service workers.
    Just additional information :)

  • @hassaneoutouaya
    @hassaneoutouaya ปีที่แล้ว

    Thank you so much!

  • @rojonali3374
    @rojonali3374 ปีที่แล้ว

    I was thinking for a few days about sending you an email to make a video about PWA and push notifications. Here is the part of those. Thanks

  • @kuroexmachina
    @kuroexmachina ปีที่แล้ว

    always cool to see native stuff

  • @Wawa-nh9sq
    @Wawa-nh9sq ปีที่แล้ว +2

    But it's actually not push notifications, if my app is closed I don't receive anything like we see in the thumbnail

  • @Opprofile
    @Opprofile 4 หลายเดือนก่อน

    Thank you!!

  • @nziokaaustin
    @nziokaaustin ปีที่แล้ว

    tutorial added to my "to try list" asap

  • @medAmineRg
    @medAmineRg ปีที่แล้ว

    thanks max thats really helpfull

  • @MrProxy10
    @MrProxy10 ปีที่แล้ว

    Just Amazing man❤❤❤❤

  • @zorogenius
    @zorogenius 11 หลายเดือนก่อน

    You earnt a subscribe, my friend.

  • @vipbossman
    @vipbossman ปีที่แล้ว

    You are the best !!

  • @Ahmedhkad
    @Ahmedhkad ปีที่แล้ว

    It's cool to try on the phone! For my own site notification

  • @pugazhonline
    @pugazhonline ปีที่แล้ว

    good as usual

  • @mubafaw
    @mubafaw ปีที่แล้ว

    Awesome!!!!!😊👍

  • @jeffryansyahputra3765
    @jeffryansyahputra3765 ปีที่แล้ว

    nice tuts...

  • @zabihullahazadzoi
    @zabihullahazadzoi ปีที่แล้ว

    great, super useful

  • @thefamousdjx
    @thefamousdjx ปีที่แล้ว

    Nice tutorial. I doubt many people actually grant that access. I always say NO when that popup shows

  • @sven_93
    @sven_93 ปีที่แล้ว +2

    Would have really liked to see how the Notifications look and work for mobile usage.
    Also interesting would be the mobile Notifications on a PWA, which looks and feels like a mobile App.

    • @universo_desconocido
      @universo_desconocido ปีที่แล้ว

      hey man did you find anything like that? I am searching for the same thing

  • @daniel-jerrehian
    @daniel-jerrehian ปีที่แล้ว

    Great video

  • @vncntkyl
    @vncntkyl ปีที่แล้ว

    This tutorial is a big help for my thesis right now! Thank you!

  • @salehm9631
    @salehm9631 ปีที่แล้ว

    Thank you

  • @ozkaninonlu2898
    @ozkaninonlu2898 ปีที่แล้ว

    Good idea !

  • @ArielZab
    @ArielZab ปีที่แล้ว +2

    Can you show us how to monitor ajax loading progress? So we can make something like a progress bar?

  • @adsaviation
    @adsaviation 2 หลายเดือนก่อน

    Wow, I love this short and the way he was explaining it, EXCELLENT. Not one time I felt lost or disorientated. K.I.S.S. is the way to go!!😀

  • @nekromenzer
    @nekromenzer ปีที่แล้ว

    cool dude , useful !

  • @shub226
    @shub226 ปีที่แล้ว

    This is dope

  • @sojumoscow
    @sojumoscow ปีที่แล้ว

    What did u do in "if" part of clearing interval, the auto closing of parenthesis?

  • @GetushaHD
    @GetushaHD ปีที่แล้ว

    The COME BACK please is having me dead.😂

  • @GallantryX
    @GallantryX ปีที่แล้ว

    Never disappoints

  • @hikari1690
    @hikari1690 ปีที่แล้ว

    Perfect! Now I can annoy people more jist for fun 🤣

  • @quynguyen2943
    @quynguyen2943 ปีที่แล้ว

    merci beaucoup a toi :))

  • @vansh1190
    @vansh1190 ปีที่แล้ว

    That's really an informative Video,
    Thanks @kyle