How to add Push Notifications to a Next.js App w/ Firebase Cloud Messaging! (Tutorial for Beginners)

  Рет қаралды 11,949

Sonny Sangha

Sonny Sangha

Күн бұрын

Free GitHub Source Code: 👉 www.papareact.com/fcm-code
🚨 Join the world’s BEST developer course & community “Zero to Full Stack Hero” NOW: www.papareact.com/course
🔴 LOOKING FOR THE CODE FROM MY OTHER BUILDS? 🛠️
links.papareact.com/github
Join me as I show you how to add & test Push notifications on iOS, Android, and Web Browsers such as Google Chrome and Safari using Firebase Cloud Messaging. You'll learn the following in this video:
👉 How to Implement Push Notifications on any Next.js App using Firebase Cloud Messaging (This configuration also lets you send iOS and Android notifications)
👉 What is Firebase Cloud Messaging and its Benefits
👉 Explaining how App States work for Notifications, such as foreground notifications (when the tab is open) and background notifications (when the tab/window is closed or out of focus)
👉 What are Service Workers & How to Implement and Debug them
👉 Explaining Firebase Cloud Messaging Best Practices
👉 How to add a toast Notification with ShadCn to handle foreground notifications
📩 WANT TO LISTEN TO THE EXCLUSIVE PAPAFAM PLAYLIST?
Sign up for the PAPAFAM Newsletter here 👉 links.papareact.com/newsletter
👇🏻FOLLOW ME HERE:
Instagram: links.papareact.com/instagram
Facebook: links.papareact.com/facebook
LinkedIn: links.papareact.com/linkedin
Twitter: links.papareact.com/twitter
Discord: links.papareact.com/discord
💰 WANT TO SUPPORT THE CHANNEL?
Donate here: links.papareact.com/donate
Grab some PAPAFAM Merch: links.papareact.com/merch
🕐 TIMESTAMPS:
00:00 Introduction
00:34 Push Notification in Firebase Cloud Messaging
01:16 Why Firebase Cloud Messaging
01:39 Explaining Firebase Cloud Messaging (1/2)
02:38 Firebase Cloud Messaging Message Types
03:20 Explaining Firebase Cloud Messaging (2/2)
03:42 Initialising the Build
04:32 Setting Up the Firebase Project
09:59 Firebase Cloud Messaging Demo
11:04 Setting Up a Messaging Campaign
14:56 Explaining App States for Notifications
16:11 What is a Service Worker?
16:40 How to Inspect & Debug a Service Worker
18:21 Purpose of Service Workers in Web Dev
20:02 Explaining How Background Messages Work
21:44 Explaining How a Service Worker Works
25:42 Implementing a Foreground State Toast Notification
32:17 Explaining the Functionality of the useFcmToken Custom Hook
50:17 Push Notification Demo for Foreground & Background App State
53:08 How & Why Tokens Are Saved to a Database
55:13 Firebase Cloud Messaging Best Practices
56:12 Summary
57:06 Join my course Zero to Full Stack Hero for more
57:55 Outro
Let’s get it PAPAFAM 🔥.
#nextjs #pushnotifications #firebase #ios #android #google #tailwindcss #typescript #testing #reactjs #javascript #nextjs15 #firebasecloudmessaging #fcm

Пікірлер: 68
@SonnySangha
@SonnySangha 24 күн бұрын
❗Join *Zero to Full Stack Hero* for *50% off* ( _48 HOUR INDEPENDANCE DAY SALE_ ) 👉www.papareact.com/course
@agadaFrancisLouis
@agadaFrancisLouis 24 күн бұрын
Not all heroes wear capes. Sonny you’re a saviour. Thank you🙏🏾❤️❤️❤️👏🏾👏🏾👏🏾
@SonnySangha
@SonnySangha 24 күн бұрын
Appreciate you!
@proflead
@proflead 13 күн бұрын
That's a really long and excellent tutorial! :) Agree?
@DigitalAlchemyst
@DigitalAlchemyst 24 күн бұрын
Aww i missed this so much so that youtube showed it still live on the home page. This is good info I know it cant wait to watch
23 күн бұрын
Great guide, thanks for putting this together! Notifications are sent twice though (13:05 in the video shows this). One of the notifs is rendered automatically by the browser. The other one is the service worker. Can the default browser notification be disabled?
@JanMager
@JanMager 20 күн бұрын
+1
@SomtochiMkparu-i7o
@SomtochiMkparu-i7o 24 күн бұрын
Thanks a lot for the tutorial, I needed something like this for a side project.
@BrutalInsights
@BrutalInsights 24 күн бұрын
Regular ❤‍🔥 tutorial Next.js app builds has been amazing! University of Code locked in and taking over keep it coming fam!
@SonnySangha
@SonnySangha 24 күн бұрын
You know it!!! The PAPAFAM is in full power!
@eliuddyn
@eliuddyn 24 күн бұрын
This is Amazing 🔥🔥
@MrJeRimes
@MrJeRimes 24 күн бұрын
Thank you so much, i've been searching for a full tutorial for web push notification with fcm
@SonnySangha
@SonnySangha 24 күн бұрын
You’re welcome!!
@developmentwithtariq
@developmentwithtariq 5 күн бұрын
Thank you for your great contribution in my life as a developer
@manmittiwade
@manmittiwade 23 күн бұрын
I'm thinking about web notification and see you are live with this ..love you brother ..❤❤❤❤
@mileslegend
@mileslegend 23 күн бұрын
you always amaze me..i have been thinking about this and boom you demystifyied it .....big up bro
@SonnySangha
@SonnySangha 23 күн бұрын
Appreciate you brother!!!
@augustineudeh1584
@augustineudeh1584 24 күн бұрын
Thank you Sonny , God bless you ❤
@SonnySangha
@SonnySangha 24 күн бұрын
Thank you for supporting!!!
@usmanmarkaz
@usmanmarkaz 23 күн бұрын
Sonny sir me awaiting for React Native full stack projects plz plz make a project playlist just like Next js
@Deus-lo-Vuilt
@Deus-lo-Vuilt 17 күн бұрын
wow , nice !!
@Soap_js
@Soap_js 24 күн бұрын
Sonny is BACK!!
@SonnySangha
@SonnySangha 24 күн бұрын
Yessssir!!!
@PHCreatives-ge9hb
@PHCreatives-ge9hb 20 күн бұрын
Love it when you're doing it live😅
@SonnySangha
@SonnySangha 20 күн бұрын
A mix of both is perfect for all!
@wafiqhosain5713
@wafiqhosain5713 24 күн бұрын
Sonny Max, Sonny Live, love ur content, bruh...
@CYCLONE_2XL
@CYCLONE_2XL 24 күн бұрын
Best ❤
@SonnySangha
@SonnySangha 24 күн бұрын
Thanks for the support!
@ninoaarondacua5975
@ninoaarondacua5975 18 күн бұрын
is this working in vercel?
@johnedet4551
@johnedet4551 15 күн бұрын
Also can you build an app, where an admin can send push notification to all his subscriber, whose tokens have been saved to the db. This would be a nice feature in an app.
@TheMrmancave
@TheMrmancave 13 күн бұрын
Hi Sonny, are you able to send these push notifications to iPhones and Android devices with a Next.js app?
@dariod7322
@dariod7322 20 күн бұрын
Can I do this using plain react and js? I don't know typescript and nextJs yet.
@SonnySangha
@SonnySangha 20 күн бұрын
Ofcourse you can!
@user-su7ew8id4e
@user-su7ew8id4e 21 күн бұрын
Hey , thanks for this wonderful video , does it work with PWA ?
@JanMager
@JanMager 20 күн бұрын
of course, yes
@user-su7ew8id4e
@user-su7ew8id4e 20 күн бұрын
@@JanMager thanks for the answer
@talhaboyraz
@talhaboyraz 18 күн бұрын
not working on ios. is there any way to chrome push notification on ios.
@juanpablocs21
@juanpablocs21 24 күн бұрын
great job. one question, this fcm is working in ios chrome?
@SonnySangha
@SonnySangha 24 күн бұрын
Yessir!
@anshsingh03
@anshsingh03 24 күн бұрын
Amazing video...... I need your help regarding notification in Safari......
@SonnySangha
@SonnySangha 24 күн бұрын
Ask away, ideally in www.universityofcode.com
@anshsingh03
@anshsingh03 22 күн бұрын
​@@SonnySangha thanks
@johnedet4551
@johnedet4551 15 күн бұрын
This doesn't work on safari.. You have any reason why?
@salyiohh
@salyiohh 24 күн бұрын
we need this for react native expo project
@SonnySangha
@SonnySangha 24 күн бұрын
I hear you!
@suchitraswain1525
@suchitraswain1525 24 күн бұрын
it's not working on the hosted URL, is there anything we need to config?
@SonnySangha
@SonnySangha 24 күн бұрын
I can’t help with this much information… it does work!
@user-sz9rf8hz5e
@user-sz9rf8hz5e 23 күн бұрын
@@SonnySangha I hosted in firebase hosting using functions it's showing 500 error
@bernardyamoah1284
@bernardyamoah1284 24 күн бұрын
💯💯😊
@SonnySangha
@SonnySangha 24 күн бұрын
Appreciate you!
@kwamenadadson
@kwamenadadson 24 күн бұрын
please can i get the source code
@SonnySangha
@SonnySangha 24 күн бұрын
First link in description!
@kwamenadadson
@kwamenadadson 24 күн бұрын
@@SonnySangha Thanks but now only the foreground works without the background
@SonnySangha
@SonnySangha 21 күн бұрын
Need to run in HTTPS to register the service worker, check your package JSON and enable experimental-https flag
@adloukondo2148
@adloukondo2148 23 күн бұрын
Salut, ttu peux nouus aider avec un tutoriel OTP. avec firebase +nextjs
@SonnySangha
@SonnySangha 22 күн бұрын
Salut, Ofcourse I’m on it!
@adloukondo2148
@adloukondo2148 22 күн бұрын
@@SonnySangha Merci beaucoup papa react 💖💖
@HKML629
@HKML629 24 күн бұрын
Hello my Boss
@SonnySangha
@SonnySangha 24 күн бұрын
Yo!!!! Enjoy the vid bro!
@HKML629
@HKML629 24 күн бұрын
@@SonnySangha Sure Brother
@HKML629
@HKML629 24 күн бұрын
@@SonnySangha I really learn alot from you i wants to show to you a project i've made to hear your insights
@SonnySangha
@SonnySangha 24 күн бұрын
Join the university of code Skool community and share inside! Www.universityofcode.com
@HKML629
@HKML629 22 күн бұрын
@@SonnySangha I do join now
@aakash8010
@aakash8010 24 күн бұрын
😘😘🤩😍🥰😇
@flutter-fm1kl
@flutter-fm1kl 22 күн бұрын
No one use RN😂
HTMX Sucks
25:16
Theo - t3․gg
Рет қаралды 112 М.
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 127 МЛН
How Many Balloons Does It Take To Fly?
00:18
MrBeast
Рет қаралды 185 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 106 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 31 МЛН
How to OVER Engineer a Website // What is a Tech Stack?
11:20
Fireship
Рет қаралды 2,3 МЛН
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 501 М.
These coding projects give you an unfair advantage
8:13
Jason Goodison
Рет қаралды 979 М.
This is Why Programming Is Hard For you
10:48
The Coding Sloth
Рет қаралды 723 М.
I'm leaving new york city
21:05
Jacob Sucks At Code
Рет қаралды 23 М.
Learn to code with an unfair advantage.
15:05
Jason Goodison
Рет қаралды 170 М.
Web Push Notifications - End to End implementation
17:24
A shot of code
Рет қаралды 103 М.
Reacting to 21 Design Portfolios in 22 Minutes
22:41
Flux Academy
Рет қаралды 529 М.
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 127 МЛН