IMPORTANT NOTES: If you run into trouble in release mode the next place to look for help would be the Expo discord server. I've tested this code in release mode and it works on my end - discord.com/invite/expo If you want to learn to send Push Notifications from your backend you can learn how to do that here - ruclips.net/video/qXZSqPGiWT0/видео.html
can you help me? When I build aab or apk it does not get the token on my physical device, it shows the token not available sign. Should I add any permissions or additional settings that are not shown in the video? thank you!
You are a g homie dude. Followed along, first test, it works, my app gets its first push notification. Simple as that. Pass the token to my api to store it with user data. Created a cron job that checks which notifications to send out to what users, now a bot can mass send relevant notifs. 1.5 hour project.
can you help me? When I build aab or apk it does not get the token on my physical device, it shows the token not available sign. Should I add any permissions or additional settings that are not shown in the video? thank you!
@@thedavistheory7674 yeah, this tutorial is updated after FCM v1, and it is still the protocol in use. There are some code need to be changed, but in general the video is still very relevant.
Hey thanks for the video, you explained well the topic and it works perfectly, you're massively underrated for tye quality of your tutorials, keep it up man.
Thank you so much for this. It's one of those things that you set up.. it fails and is impossible to debug.. but thanks to you I've finally get it working!
How does it work when app is killed or in background state? I am passing a url in notification from server but it is just opening app and function is not getting triggered. Any workaround?
Hi, I need to send title and body message in both English and Arabic. I am sending the info using data field. is it possible to show notification according to the user app language preference?
Hey man with expo push notifications on ios everything works on expo go but not testflight in regards to it being able to access the push notification as if you already had them with expo go it all works its just retrieving it oit after building that fails, do you know why this is?
Amazing, I think just onething will be fantastic application for changeable data real time and show the data on bar in lock screen and bar when swap down and also can control it show/hide with react native 🔥🔥
thanks for the insightful video, Dan! Subscribed! I wonder how about handling the push notification, e.g. navigate to a particular screen when user taps the notification, etc ?
Hi, good video. I have a couple of questions: 1. When the app goes to production, how does the notification work? How does the push token get registered with Firebase Cloud Messaging? 2. Is this possible to test through Firebase Cloud Messaging? It asks from a FCM Token there, and not a ExpoPushToken
So this is the update that needs to be done after June 2024 that you talked about in the previous video: replace the FCM (legacy) server key with the FCM v1.. is it correct? I watched the video and it seems like the only thing that changes compared to the old video... the code has remained almost unchanged... or am I wrong? Thank you!
i personally don't want to use firebase, i went with the method of ios and using js not tsx and i did get the notification, am i good to go? or do i HAVE to use firebase
Thank you for this tot, can you show us how to send notification like in social media when someone following you or something like that and thank you again this was so helpful .
This video talks about how to send push notifications from Backend Learn to Send Expo Push Notifications From A Server ruclips.net/video/qXZSqPGiWT0/видео.html
sir I am getting the same problem as you mentioned earlier that the firebase is not initialized and i litrally couldn't find any solution actually i was getting this before too but I thought you won't be getting this error by the way you are doing so i followed along but now i am still getting the error please share some details on how you fixerd this problem as i am encountring this problem from almsot a week still no work around and no solution.
Hi , first of all thanks for the tutorial appreciated it , but do we not need to add expo notification into app.json plugins? and also does it work on local build instead of eas build thank you
I would like to know background notification if we send through FCM and Firebase it will appear on all devices background on the install app or relevant user device only ? How it works ? We need to do extra controls
Nice!!! I have a question. If i deploy app to google play or app store. This notifications with the ExponentPushToken still work?? I want to send to all divices than download my app.
Question: how would I go about linking the notifications to a certain condition, e.g. sending a fitness reminder if the user hasn't done their daily workout?
Hello Dan, Thank you for the very good video. I am developing a sports app and I would like to send push notifications (game start, goal) to users who are following teams that are currently in a live match. I have a firebase cloud functions which is streaming the match. I am working in Expo and I have been reading about firebase topic messaging, but apparently it does not work with Expo. Would you recommend rejecting expo or trying to handle it through a custom backend like cloud Firestore? Or maybe you have even a different idea. -Jari:)
Thank you very much bro! That was really helpful. Could you also share how to send a notification to all users of the app? Do I have to save all the tokens and send them individually?
Hey Dan, thanks for uploading this video, it has really helped me in my capstone project! I'm trying to run a build on iOS for notification testing purposes, but I can't get past when it asks for my apple creds. Is this something I can only get access to if I pay the $99/year for an apple developer account?
Hello @DanRNLab. I currently am running a development build for android. Whenever I click on my notification that I receive, it seems to rebuild the application. Is this normal behavior? If I have the app closed, but in the background, it also seems to rebuild. My goal is to be able to route using notification data, however, after following the documentation, it doesn't seem to route either.
The bundling part after reopening is normal. It doesn’t happen in release mode. The routing stuff sounds off tho. I recommend taking this to the Expo discord discord.com/invite/expo
My application is handling push notifications fine in the development build but on TestFlight it is not getting the expo push token… any ideas why that is? Problem started happening when upgrading from expo 47-50. Would appreciate the help:)
I update my project but when I press a button in my app that should send notifications to users, it is only sent to some of them. I don't understand why. Every time a user logs in, the token is taken via custom hook and saved in the DB in that user's collection. When in the app, I press a specific button I send the notification via POST request as explain in the expo documentation. Under "to" I pass the array with the tokens of the various users registered in the app. Is this logic correct? Thanks
Thank you for your video I managed to compile your project. As a complete beginner I would like to know if it is possible to push notification with your projet on a pure emulator running on Google Play API? Thank you!
That's awesome! I've managed to make it work following your steps. But now I wonder: how to actually implement it via API? I mean, send contextualized notifications.
If you mean sending them from a Backend this is my video on the subject. I hope this can help Learn to Send Expo Push Notifications From A Server ruclips.net/video/qXZSqPGiWT0/видео.html
Hey Dan, thank you for the great video. I'm wondering how I'd send a notification to all the users? Do I have to collect and store all users' Expo push tokens and then use Expo REST API or is there a better way?
Thank you very much for this video, really helped me. If I put the Firebase file inside android directory, every time prebuild is called that would remove it, I think that's not ideal... Any solution for that?
Hi Dan, I have a question. Could we build but dont use EAS, like run locally, I try to run npx expo run:ios and npx expo run:android but when I enter the app, it show me the alert that "Must be using a physical device for Push notifications", which means it is not a physical device.
I think you can build locally, however you still need two things: 1) You need to set up your credentials with EAS 2) You must use a physical Android or iPhone. Simulators will not work at all.
hey Dan, awesome video! I implemented expo notification and background service for my application, but it only works on simulator, emulator and expo development build. It doesn't work on android apk. Can you help me understand what could be wrong here?
I followed the tutorial and everything works fine on ios and in android expo go but on android development build and in actual apk after notification arrives and i open app it cant recieve data.when app is killed addNotificationResponseReceivedListener is not getting triggered.I saw several github issues with same problem and some workarounds but on expo 50 nothing really worked. is it expo problem and is there any workaround or fix for it? thanks for the video.
I see, if you are still having issues I recommend the Expo Discord. I am in there too sometimes, you can get a lot of good help here: discord.com/invite/expo
Great video! What If I had a backend .NET server and SqlServer for DB. I want to trigger a push notification from my backend server to specific users, is it possible? I have to store the expo token in db so backend could do it? Thanks!
This is how I did it in NodeJS. Maybe you can adapt it? It is along those lines though Learn to Send Expo Push Notifications From A Server ruclips.net/video/qXZSqPGiWT0/видео.html
Do you mean sending notifications to several different users? For that you would need a backend. I explain here Learn to Send Expo Push Notifications From A Server ruclips.net/video/qXZSqPGiWT0/видео.html
Guys but how do I actually send those notifications directly from the server? Great video, but everyone stops on the push tool, I want to know how to send them from server! I can't get the v1 push to work
Hi Dan, Video was amazing, but what if i want to integrate deep linking in our application, when app is in kill mode I'm not able to get payload data to navigate particular screen It would be very helpfull, if u make video on that Thank you
Hey, happy I could help. I am not sure why the deep linking doesn’t work but I recommend for now checking out the Expo Discord. It is very active and they likely can help you there discord.com/invite/expo
@@DanRNLab great thanks, and the key for android (firebase generated key from the services) if we work in group do each of them need to generate a key? Or if they are logged into the acc it becomes there?
@@DanRNLabthanks for saying lol I haven’t finished building my app all the way through yet cause I still gotta get a merchant bank account and incorporate a company
@@DanRNLab Thanks for replying! I walked through your steps, which include prebuild, and it did work for expo go too, on android at least. Do you have any suggestions if and how can I test it on iOS as well?
@bayramcinarr unfortunately, if the video steps didn’t work for you I am not sure why you are having problems. Discord is the best backup resource for those who are having trouble.
Hello, my steps are the same as yours, but my result is:"Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE"; Is it due to the network?----I am in China。
IMPORTANT NOTES:
If you run into trouble in release mode the next place to look for help would be the Expo discord server. I've tested this code in release mode and it works on my end - discord.com/invite/expo
If you want to learn to send Push Notifications from your backend you can learn how to do that here - ruclips.net/video/qXZSqPGiWT0/видео.html
can you help me? When I build aab or apk it does not get the token on my physical device, it shows the token not available sign.
Should I add any permissions or additional settings that are not shown in the video?
thank you!
@@maximilianomonsalbe2862Hello, I have the same problem, did you find a solution?
@@maximilianomonsalbe2862 Hello, I have the same problem, did you find a solution?
This helped me get through Android problems I was having. Works now thank you
Happy to help!
You are a g homie dude.
Followed along, first test, it works, my app gets its first push notification. Simple as that.
Pass the token to my api to store it with user data. Created a cron job that checks which notifications to send out to what users, now a bot can mass send relevant notifs. 1.5 hour project.
can you help me? When I build aab or apk it does not get the token on my physical device, it shows the token not available sign.
Should I add any permissions or additional settings that are not shown in the video?
thank you!
Thanks for putting out a new video Dan! This helped me implement push notifications in my app
Happy to help!!! 😀
Thanks for the tutorial, it still helps people like me half year later. Thanks for your work.
Happy to help!
Still works?
@@thedavistheory7674 yeah, this tutorial is updated after FCM v1, and it is still the protocol in use. There are some code need to be changed, but in general the video is still very relevant.
Thanks dude! It works! I'm building smart campervan app and push notifications was my latest TODO :D Yeah it WAS, thanks to you! :)
A truly comprehensive tutorial! Thanks!
Thank you! I am learning about mobile development and your video helped a lot!
Happy to help 🙂
Hey thanks for the video, you explained well the topic and it works perfectly, you're massively underrated for tye quality of your tutorials, keep it up man.
Thanks for the kind words 🙂
Thank you so much for this. It's one of those things that you set up.. it fails and is impossible to debug.. but thanks to you I've finally get it working!
finally a tutorial that works. thumbs up
Happy to help!!!
How does it work when app is killed or in background state? I am passing a url in notification from server but it is just opening app and function is not getting triggered. Any workaround?
Deep linking
Are you not using things like Zustand for state management?
Please have you had any success with this? I’ve also been stuck on this for almost a year now
That's the thing what I was looking for, thanks!
Happy to help!!! 😀
Hi,
I need to send title and body message in both English and Arabic. I am sending the info using data field. is it possible to show notification according to the user app language preference?
YOU ARE GOD
You just saved our whole project
Love you
Happy to help 🙏
How can we group notifications differently e.g. like whatsapp does to conversations?
In 16:40, when you refresh the page you are already expecting for your project to appear. What action triggered that? Thank you.
How to fix in a prebuild the expo push notification token return undefined?
did you got a solution ?
@@nithish8111 none dude
Hey man with expo push notifications on ios everything works on expo go but not testflight in regards to it being able to access the push notification as if you already had them with expo go it all works its just retrieving it oit after building that fails, do you know why this is?
Incredibly useful. Thank you so much man
Happy to help!!! 😀
can I do this in expo development build without eas services?
Amazing, I think just onething will be fantastic application for changeable data real time and show the data on bar in lock screen and bar when swap down and also can control it show/hide with react native 🔥🔥
thanks for the insightful video, Dan! Subscribed!
I wonder how about handling the push notification, e.g. navigate to a particular screen when user taps the notification, etc ?
Push notifications can be sent with a data payload. You can then use that data when the application opens to navigate to a screen
Hi, good video.
I have a couple of questions:
1. When the app goes to production, how does the notification work? How does the push token get registered with Firebase Cloud Messaging?
2. Is this possible to test through Firebase Cloud Messaging? It asks from a FCM Token there, and not a ExpoPushToken
great to see another video!!
you're a lifesaver thank you so much for this!!
Happy to Help!
So this is the update that needs to be done after June 2024 that you talked about in the previous video: replace the FCM (legacy) server key with the FCM v1.. is it correct? I watched the video and it seems like the only thing that changes compared to the old video... the code has remained almost unchanged... or am I wrong? Thank you!
Yes, you only need to upload the V1 token like I do in the Android part.
Hey Dan, what are we supposed to do if we already have a google-services file for google oauth? Do we merge the two files?
i use firebase and in server should be spratlky configure this?
Not finding the FCM section under credentials - where did it go?
how to generate the android and ios folders for expo?
Thanks a lot for explain with simple and perfect
i personally don't want to use firebase, i went with the method of ios and using js not tsx and i did get the notification, am i good to go? or do i HAVE to use firebase
Hey, did you manage to solve this. I would like to do it without firebase either, but not sure if it's possible.
Thank you for this tot, can you show us how to send notification like in social media when someone following you or something like that and thank you again this was so helpful .
This video talks about how to send push notifications from Backend
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
Quick question you are building using EAS build but also building locally using "npx expo run:ios --device". Do you need to do both?
The -device just builds locally. You don’t need EAS for that
How to attach an image in FCM expo notification. It works messege body text but how to insert a image
sir I am getting the same problem as you mentioned earlier that the firebase is not initialized and i litrally couldn't find any solution actually i was getting this before too but I thought you won't be getting this error by the way you are doing so i followed along but now i am still getting the error please share some details on how you fixerd this problem as i am encountring this problem from almsot a week still no work around and no solution.
Hi , first of all thanks for the tutorial appreciated it , but do we not need to add expo notification into app.json plugins? and also does it work on local build instead of eas build thank you
I would like to know background notification if we send through FCM and Firebase it will appear on all devices background on the install app or relevant user device only ? How it works ? We need to do extra controls
This video may answer your questions
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
Nice!!! I have a question. If i deploy app to google play or app store. This notifications with the ExponentPushToken still work?? I want to send to all divices than download my app.
Question: how would I go about linking the notifications to a certain condition, e.g. sending a fitness reminder if the user hasn't done their daily workout?
You can schedule notifications locally if you like
docs.expo.dev/versions/latest/sdk/notifications/#schedule-notifications
Thanks, this was helpful.
great video. how are you connecting the android device to your mac?
Just through a standard USB-C nothing special
How To Add Custom Notificaion sound in expo notifications?
Hello Dan,
Thank you for the very good video. I am developing a sports app and I would like to send push notifications (game start, goal) to users who are following teams that are currently in a live match. I have a firebase cloud functions which is streaming the match. I am working in Expo and I have been reading about firebase topic messaging, but apparently it does not work with Expo. Would you recommend rejecting expo or trying to handle it through a custom backend like cloud Firestore? Or maybe you have even a different idea.
-Jari:)
Hey, I am not really sure about what all the limitations are. I recommend asking in the expo discord
discord.com/invite/expo
Thank you very much bro! That was really helpful. Could you also share how to send a notification to all users of the app? Do I have to save all the tokens and send them individually?
I usually associate a token with a user yes: ruclips.net/video/qXZSqPGiWT0/видео.html
Hey Dan, thanks for uploading this video, it has really helped me in my capstone project!
I'm trying to run a build on iOS for notification testing purposes, but I can't get past when it asks for my apple creds. Is this something I can only get access to if I pay the $99/year for an apple developer account?
Hey, happy to help. Yes you need the Apple account
I get happy seeing your face
Hello @DanRNLab. I currently am running a development build for android. Whenever I click on my notification that I receive, it seems to rebuild the application. Is this normal behavior? If I have the app closed, but in the background, it also seems to rebuild. My goal is to be able to route using notification data, however, after following the documentation, it doesn't seem to route either.
The bundling part after reopening is normal. It doesn’t happen in release mode. The routing stuff sounds off tho. I recommend taking this to the Expo discord
discord.com/invite/expo
will this also work for expo managed workflow?
Unfortunately no, you need a development build
My application is handling push notifications fine in the development build but on TestFlight it is not getting the expo push token… any ideas why that is? Problem started happening when upgrading from expo 47-50. Would appreciate the help:)
On my end this works in release mode, you may want to try and look into the Expo Discord Server for more help - discord.com/invite/expo
I update my project but when I press a button in my app that should send notifications to users, it is only sent to some of them.
I don't understand why.
Every time a user logs in, the token is taken via custom hook and saved in the DB in that user's collection.
When in the app, I press a specific button I send the notification via POST request as explain in the expo documentation.
Under "to" I pass the array with the tokens of the various users registered in the app. Is this logic correct?
Thanks
At this point I am unsure, I recommend asking in the Expo Discord
discord.com/invite/expo
Thank you for your video I managed to compile your project.
As a complete beginner I would like to know if it is possible to push notification with your projet on a pure emulator running on Google Play API?
Thank you!
Thanks for this!
Happy to help!
Very helpful! Looks like the sample repo link is broken though.
Thanks I’ll fix it now
The repo is now public and the link should work. Thanks for the heads up!
That's awesome! I've managed to make it work following your steps. But now I wonder: how to actually implement it via API? I mean, send contextualized notifications.
If you mean sending them from a Backend this is my video on the subject. I hope this can help
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
Hey Dan, thank you for the great video.
I'm wondering how I'd send a notification to all the users? Do I have to collect and store all users' Expo push tokens and then use Expo REST API or is there a better way?
I have a video about it here
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
@@DanRNLab Oh thanks. It follows a similar approach as I described.
Thank you very much for this video, really helped me. If I put the Firebase file inside android directory, every time prebuild is called that would remove it, I think that's not ideal... Any solution for that?
Maybe try putting it at the root directory and then pointing your app.json at that path?
Hi Dan, I have a question. Could we build but dont use EAS, like run locally, I try to run npx expo run:ios and npx expo run:android but when I enter the app, it show me the alert that "Must be using a physical device for Push notifications", which means it is not a physical device.
also I dont have a Apple paid developer account, maybe consider switching to Android
I think you can build locally, however you still need two things:
1) You need to set up your credentials with EAS
2) You must use a physical Android or iPhone. Simulators will not work at all.
This will not work on iOS without a paid developer account. You’ll need to switch to Android
Oh ok, I guess I have to plug my actual physical device using USB to my Mac
hey Dan, awesome video!
I implemented expo notification and background service for my application, but it only works on simulator, emulator and expo development build.
It doesn't work on android apk. Can you help me understand what could be wrong here?
I haven’t seen this problem in my environment. It’s best to double check this with the expo team in their discord
discord.com/invite/expo
I'm facing the same issue, the token shows as undefined. Would you mind sharing your solution?
i dont have android folder, do i need to prebuild it?
When you do prebuild it generates it for you
can you get notification while the app is on the foreground
I think that should work
I followed the tutorial and everything works fine on ios and in android expo go but on android development build and in actual apk after notification arrives and i open app it cant recieve data.when app is killed addNotificationResponseReceivedListener is not getting triggered.I saw several github issues with same problem and some workarounds but on expo 50 nothing really worked. is it expo problem and is there any workaround or fix for it? thanks for the video.
I see, if you are still having issues I recommend the Expo Discord. I am in there too sometimes, you can get a lot of good help here: discord.com/invite/expo
Thanks for the reply. I will ask for help there.
Beautiful.
Must it be in typescript?
If you remove the type annotations it should work in JS as well
Great video! What If I had a backend .NET server and SqlServer for DB. I want to trigger a push notification from my backend server to specific users, is it possible? I have to store the expo token in db so backend could do it? Thanks!
This is how I did it in NodeJS. Maybe you can adapt it? It is along those lines though
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
How can I send notifications through firebase?
Do you mean sending notifications to several different users? For that you would need a backend. I explain here
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
Guys but how do I actually send those notifications directly from the server? Great video, but everyone stops on the push tool, I want to know how to send them from server! I can't get the v1 push to work
I have a video on sending from the server here: Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
@DanRNLab thank you so much for taking time to reply. Checking it out right away or burning my mac. One of the 2!
Hi Dan,
Video was amazing, but what if i want to integrate deep linking in our application, when app is in kill mode I'm not able to get payload data to navigate particular screen
It would be very helpfull, if u make video on that
Thank you
Hey, happy I could help. I am not sure why the deep linking doesn’t work but I recommend for now checking out the Expo Discord. It is very active and they likely can help you there
discord.com/invite/expo
Do i have to have the paid developer id from apple?
To set up push notifications yes you do
@@DanRNLab great thanks, and the key for android (firebase generated key from the services) if we work in group do each of them need to generate a key? Or if they are logged into the acc it becomes there?
@@DanRNLabthanks for saying lol
I haven’t finished building my app all the way through yet cause I still gotta get a merchant bank account and incorporate a company
Would this work on expo go?
No, you need to prebuild
@@DanRNLab Thanks for replying! I walked through your steps, which include prebuild, and it did work for expo go too, on android at least. Do you have any suggestions if and how can I test it on iOS as well?
Np! I don’t have any extra suggestions beyond what is in the video
it is not working in my APK app. İs it just working in Expo go ?
I have information about this in the pinned comment.
@@DanRNLab I dont have discord account do you know the solution ?
@bayramcinarr unfortunately, if the video steps didn’t work for you I am not sure why you are having problems. Discord is the best backup resource for those who are having trouble.
how to send a notification to the application from the backend (python example)? please help ╥﹏╥
Hey I have a video here
Learn to Send Expo Push Notifications From A Server
ruclips.net/video/qXZSqPGiWT0/видео.html
Thanks Man
really helped
can u make a video on push notification with firebase it’s urgent ‼
Unfortunately, I only had time to do this one at the moment.
No matter what i do, i keep getting the "Firebase not initialized" error 😔
same here i keep getting "Firebase not initialized". Did u get it working?? If so what mistake did u make ??
Thanks!!!!
wow!
i love you
Hey you Stole my Outro, Happy Hacking! 😊 just kidding
I think we all stole it from @wcandillon at the end of the day haha.
No Paid Apple Account = No Hope
Hello, my steps are the same as yours, but my result is:"Fetching the token failed: java.util.concurrent.ExecutionException: java.io.IOException: SERVICE_NOT_AVAILABLE";
Is it due to the network?----I am in China。
Unfortunately, many Firebase features are not available in China.
You are my fcking hero mate
Happy to help!!!
you're a lifesaver..!!!🥹 thank you so much for this video.
Happy to help!!! 🙏