Send Push Notifications with FCM using C# (Topics & Tokens)

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

Gerald Versluis

Gerald Versluis

Күн бұрын

Пікірлер: 220
@kfestofil3249
@kfestofil3249 2 жыл бұрын
I spent 4 hours scrolling through microsoft documentation, couldn't even make it compile afterwards because everything was outdated. I watched your 2 videos, and it took me less than an hour to set up a client-server communication. Thanks man!
@jfversluis
@jfversluis 2 жыл бұрын
Amazing, thank you so much for taking the time to let me know! This is hard stuff, and this wasn't easy to create. Glad it is helping people :)
@amals.alzuhair84
@amals.alzuhair84 3 жыл бұрын
This video should be the go-to video for anyone who wants to understand the push notification through C# Thank you a million tutor! You have created a great work
@jfversluis
@jfversluis 3 жыл бұрын
Thank you so much!
@SupremeBeever
@SupremeBeever 3 жыл бұрын
I can't seem to find out how to enable sound or pop up the notification card using this api for pushing a notification. It's in the Firebase cloud messaging dashboard when you send a test notification where you can enter the channel name and enable sound, but it seems this api doesn't expose all the settings. Using the code from this video if you're already in the application when you receive the push notification, you won't realize you received a notification. It only shows when you're out of the app.
@YTYTYTYT
@YTYTYTYT 3 жыл бұрын
How to find the path of the json file if the we put the programs.cs code in the mainpage.cs
@jfversluis
@jfversluis 3 жыл бұрын
I don't think you should be running the from the MainPage.cs :) You would want to implement some kind of server that triggers these notifications. If you do want to do this, add the json file to the resources and link to that docs.microsoft.com/xamarin/xamarin-forms/data-cloud/data/files?tabs=macos#loading-files-embedded-as-resources
@niharikasaraswat2181
@niharikasaraswat2181 2 жыл бұрын
Please upload video for firebase analytics in xamarin 🙏🙏🙏i m facing soo much issues
@AbhishekSingh-vp2qi
@AbhishekSingh-vp2qi 3 жыл бұрын
Can you please make a video on scheduling the firebase push notification through code
@jfversluis
@jfversluis 3 жыл бұрын
What is your use-case here? Just trying to understand :) I think the scheduling should happen somewhere in your code, not sure if it can be done with Firebase
@EdRawrDev5813
@EdRawrDev5813 3 жыл бұрын
Dear sir Gerald something I really appreciate will be if u make a videa about how to trigger different events or send to different pages when you tab the notification 😱🤯 blow mind 💀💜 ty , sincerely Ed.
@R3muSDan
@R3muSDan 2 жыл бұрын
Indeed, it would be great to a see a video about this.
@JoeBagodonuts7729
@JoeBagodonuts7729 9 ай бұрын
@Gerald Versluis - I would LOVE to see a series on "So your app works great; now what??" This would be a series of videos explaining in detail how to take all the steps necessary to launch on the App Store or the Play Store. I STILL find the tokens and keys that Apple forces you to have (even to deploy to your own phone), and all the hoops they make you jump through - to be overwhelming! From the simplest deployment (maybe I don't need to make money - but want to share my ideas with the world) to the most complete deployment. I think that series would be awesome and very helpful!
@mustwatch3169
@mustwatch3169 Жыл бұрын
Hello Mr I just wanna ask you how can I send notification when I press a button within the app it self so when user click send I got a notification in another device which is subscribed to a topic , you done this here but using a console app
@ibsmdmosabbir
@ibsmdmosabbir Ай бұрын
How to implement push notification in .NET MAUI , with .NET 8 version, for android and iOS both , using Firebase , could you make a seprate video
@jfversluis
@jfversluis Ай бұрын
I will make a video, but it will use Azure Notification Hubs!
@cizzl3702
@cizzl3702 2 жыл бұрын
I understand the point of sending notifications thru server. But is it also okay to send notifications directly from app? So e.g. a timer ends, then send a push notification? Or is that not possible because the app has to run or be in background?
@jfversluis
@jfversluis 2 жыл бұрын
The app will have to run in the foreground for that and also; what happens if your device doesn’t have an internet connection for instance?
23 күн бұрын
getting error The registration token is not a valid FCM registration tokene
@sal96ali
@sal96ali Жыл бұрын
I've created NotificationHelper class in shared file and do as you explained I am facing a problem in determining the private_key.json path 'Could not find file "/private_key.json"' "I am not smart as you said 😢😢😢😢😢😢😢😢" I tried many ways I need help!!!!
@junaidkhanmomin7955
@junaidkhanmomin7955 3 ай бұрын
In Visual Studio Set Build Action = Content and Copy To Output Directory = Copy always. Also set proper path to the key file such as FromFileAsync("Data\\Keys\\firebaseAdminKey.json", cts.Token)
@heinzd5523
@heinzd5523 3 жыл бұрын
Last year I spent hours trying to figure you how to implement push notification. You are the man!!!!
@jfversluis
@jfversluis 3 жыл бұрын
Woohoo! Yeah it can be a chore... I think it helps to just see how someone else does it, repeat the steps and that makes it stick better for you as well. Glad it helped, thanks!
@emax1500
@emax1500 3 жыл бұрын
Is this push notification works even the app is not running in background. Thank you for this video.
@jfversluis
@jfversluis 3 жыл бұрын
THis works even when not running in the background :)
@natureandfun62
@natureandfun62 Жыл бұрын
can u plz help in creating a web API (C#) to send push notifications may be after certain interval of time
@jfversluis
@jfversluis Жыл бұрын
I'm planning on doing push notifications again soon with .NET MAUI
@EdJastre
@EdJastre Жыл бұрын
Thanks for the videos. I don't have a backend service or API, what you recommend to send Push Notifications? Embed the Send service in the Xamarin Forms Shared Project? Is it possible?Thanks
@angelb.vasquez8981
@angelb.vasquez8981 2 жыл бұрын
Hey general, can you help me with a small mistake that I have. I am trying to send the notification by mvvm in the general project, through a button, but I get an error. it tells me that the private_key.json was not found. Would you help me there? I would really appreciate it. Thanks in advance!!!
@jfversluis
@jfversluis 2 жыл бұрын
It’s pretty hard to help with that. Can be a lot of things. Make sure you set the right Build Action on it and double-check if the json file ends up in your app package
@angelb.vasquez8981
@angelb.vasquez8981 2 жыл бұрын
@@jfversluis Validate everything, the compilation is correct and the location is the same.
@pwsherif4545
@pwsherif4545 Жыл бұрын
Hello, Thanks a lot, I created ConsoleApp, then I converted it to a library and I wanted to define and test the notification sending function in my xamarin project, but it is having trouble finding the private_key.json file, what should I do?
@testertester7963
@testertester7963 2 жыл бұрын
Please go step by step.
@jfversluis
@jfversluis 2 жыл бұрын
I don’t understand, I think that’s what I’m doing 😄
@abhishekbhujel4158
@abhishekbhujel4158 3 ай бұрын
Thank you for this video now I can finally send push notifications to my flutter app from the admin panel. Thanks once again.
@jfversluis
@jfversluis 3 ай бұрын
Yep shouldn’t matter wat the actual framework is you’re using!
@sandrocirlinisa
@sandrocirlinisa 10 ай бұрын
do you have the link to video on change icon badge of notification?
@berat4935
@berat4935 Жыл бұрын
@jfversluis, Hello, thank you very much for making this video. There is something I want to ask you. How can I send Link(url) for notification sent with Push Notification in c#?
@mortezanejat8707
@mortezanejat8707 2 жыл бұрын
ive got a stupid question. do u know what the "ctl + k + d" is in visual studio for mac? im not able to figure this out :(
@jfversluis
@jfversluis 2 жыл бұрын
It depends on which scheme you have configured. I think it should list the shortcut key in the menu in the top of your screen and it should tell you in the configuration under the preferences
@ramakrishnaboyapati9930
@ramakrishnaboyapati9930 2 жыл бұрын
What is private_key.json? Where can I get?
@jfversluis
@jfversluis 2 жыл бұрын
It’s explained in the video around the 4 minute mark
@hexoter
@hexoter 2 жыл бұрын
Hi Gerald , thx a lot for the videos you are posting , you do a great job. I did your example and works fine except FirebasePushNotificationManager.IconResource = Resource.Drawable.appIcon; the default notification icon wont change. Can you please help with a suggestion ? Thx a lot in advice
@neangdara4180
@neangdara4180 2 жыл бұрын
I got this error: The SSL connection could not be established, see inner exception
@jfversluis
@jfversluis 2 жыл бұрын
You probably want to have a look at the inner exception for the real reason and fix that :)
@JoeBagodonuts7729
@JoeBagodonuts7729 2 жыл бұрын
@Gerald Versluis - I'm using Firebase for push notifications (working fine thanks for your help)... I'd like to know how to send a push notification so that it work like a Local Notification. ie, Will show onscreen even when the power is off; Auto increments the App Icon Badge number and can be written to a local data store even when the app is closed. Do you have any videos about how to accomplish that??
@jfversluis
@jfversluis 2 жыл бұрын
I have a video on local notifications here: kzbin.info/www/bejne/Y3_NkIeIhdGrY5o
@mrwhammer
@mrwhammer 2 жыл бұрын
so its not possible to query so it reads the notifications and if it receives this specific notification it would then send you a notification with a delay of 5 seconds for 30 times?
@jfversluis
@jfversluis 2 жыл бұрын
Not sure what you mean, sorry
@ThulaniMabaso-o2z
@ThulaniMabaso-o2z 5 ай бұрын
nIce, thank you.
@neangdara4180
@neangdara4180 2 жыл бұрын
Hi, I got "The default FirebaseApp already exists." error when I call the api twice. Could you help?
@jfversluis
@jfversluis 2 жыл бұрын
Probably you're calling some initialization line twice, just remove that and do it once and you should be good
@neangdara4180
@neangdara4180 2 жыл бұрын
@@jfversluis Nope. once I consume my method do this. so how to prevent it? FirebaseApp.Create(new AppOptions() { Credential = GoogleCredential.FromFile(firebaseKey) }) ;
@sebengabriel
@sebengabriel Жыл бұрын
Não funciona na API 33 Android 13.0 Onde posso encontrar documentação para isso. Desde já agradeço
@jfversluis
@jfversluis Жыл бұрын
The link to the plugin repository is in the video description!
@sebengabriel
@sebengabriel Жыл бұрын
@@jfversluis Continuo sem compreender, o seu conteúdo é incrível, porém deveria haver uma possibilidade de atualização no seu vídeo pois o Android 13.0 tem um comportamento bem diferente dos demais e vc é um dos únicos que fala de xamarin ainda no youtube. Se eu me tornar membro, vc grava um vídeo para nós sobre essa atualização?
@christianzaragoza7575
@christianzaragoza7575 2 жыл бұрын
Hola Gerald antes que nada muchas gracias por tus videos, son geniales. Cuando quiero mandar la notificación me da error: Excepción producida: 'System.FormatException' en System.Private.CoreLib.dll Excepción no controlada del tipo 'System.FormatException' en System.Private.CoreLib.dll The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. Alguna idea de lo que pude ser? muchas gracias.
@georgeg1565
@georgeg1565 3 жыл бұрын
Hey Gerald, thanks for the video. I have a question. How many topics can the console app create. In the documentation it says that an app instance can subscribe to no more than 2k topics which is great. However it doesn't mention how many topics can be created (from the console app). I have a use case where I need to send targeted notifications to specific users. So I created a topic for each and every one based on my users' email. My user database is quite small for now, about 2k subscriptions. Would you go with topics in this scenario, as I am, or with tokens? Any input, thoughts are welcome. Thanks!!
@jfversluis
@jfversluis 3 жыл бұрын
I wouldn't create a topic per user, that kind of defeats the purpose. And for a topic I can imagine you can have unlimited tokens. So think hard about how you want to create your topics and you should be good I think. If you do that right I don't see how you would even reach 2k topics :D
@georgeg1565
@georgeg1565 3 жыл бұрын
@@jfversluis Thank you Gerald!!
@Alireza-in9se
@Alireza-in9se 2 жыл бұрын
Hi Gerald Thank you so much for making this video 💗 I have a question: How can I get data witch I have sent with message in xamarin forms, after I click on notification. Sorry if my English is bad
@mozamilahmadafghan4889
@mozamilahmadafghan4889 3 жыл бұрын
Hello! Need your help, please! I have put the private key in Shared Project root, it throws this error, "System.IO.FileNotFoundException: 'Could not find file "/private_key.json"'.
@jfversluis
@jfversluis 3 жыл бұрын
Make sure that the file is copied to the output together with the program or use any of the other methods recommended
@shivaninaeck2524
@shivaninaeck2524 2 жыл бұрын
Does this work without adding the app on firebase?
@jfversluis
@jfversluis 2 жыл бұрын
Not sure what you mean. To use Firebase you will always have to make an app registration
@jennablackwell2426
@jennablackwell2426 Жыл бұрын
Thank you for this video! So, just to clarify, it looks like going through Azure Notification Hub is not necessary to send to both iOS and Android using the Firebase Admin SDK?
@jfversluis
@jfversluis Жыл бұрын
That is correct, Azure Notification Hub and Firebase are similar products, they allow you to send push notifications across different platforms. It makes sense to choose one or the other. This might also help: kzbin.info/www/bejne/d3y8lpWnhKh0sLs
@nazariiboichyshyn4300
@nazariiboichyshyn4300 2 жыл бұрын
what about groups in firebase is it deprecated?
@jfversluis
@jfversluis 2 жыл бұрын
Looks like it’s still a thing: firebase.google.com/docs/cloud-messaging/android/device-group
@mobilewrench9721
@mobilewrench9721 2 жыл бұрын
I am getting errors while using Token {"SenderId mismatch"}. But using Topics it is sending. What will be the reason?
@jfversluis
@jfversluis 2 жыл бұрын
Hm make sure that all api keys and such match. I’m sure you can find some more info if you search for that error message:)
@winningsih8229
@winningsih8229 Жыл бұрын
Hallo sir, thank you very much for the video. I did your example and works fine. I have a request, would you like to make tutor, to use push notification from backend.
@jfversluis
@jfversluis Жыл бұрын
I don’t understand. This video shows you how to do it from a backend. Take this code and put it in your ASP.NET project and it should work :)
@meloimagpantay7904
@meloimagpantay7904 3 жыл бұрын
Be a member of this guy's channel to properly thank and support him for his great videos like this.
@jfversluis
@jfversluis 3 жыл бұрын
I approve of this message! Thanks for your support 😄❤️
@shahidouahdi3814
@shahidouahdi3814 2 жыл бұрын
Great great great work man ! much appreciated !! I have a question tho about the number that should appear on the app icon. like when u get 3 notifications, there is the number 3 that appears on the icon and so on ... do you have any idea about that ?
@mydronesamadvanes7854
@mydronesamadvanes7854 3 жыл бұрын
But how do you send it to a specific CHANNEL? What you showed here actually makes the Android to automatically create a channel called 'Miscellaneous' and not to the channel you just created.
@jfversluis
@jfversluis 3 жыл бұрын
You can specify it in the send notification body, it is a property on that object. Also see: firebase.google.com/docs/cloud-messaging/http-server-ref
@ervis.s
@ervis.s 3 жыл бұрын
Thank you for this tutorial, Topic mode is very useful 👍🏻
@jfversluis
@jfversluis 3 жыл бұрын
Yep! Depending on your use case that can come in very handy!
@julybrown4916
@julybrown4916 2 жыл бұрын
Quick one, on IOS notifications do come through but without a sound, is there a way around it?
@jfversluis
@jfversluis 2 жыл бұрын
There is a setting for that when sending the notification
@julybrown4916
@julybrown4916 2 жыл бұрын
@@jfversluis Any idea where I can find it?
@samsuofficial
@samsuofficial 3 жыл бұрын
Hello. i try the step one by one but when i test send first sample notif from console firebase.. never show notif.. no error
@jfversluis
@jfversluis 2 жыл бұрын
Hey there! The debugging can be a bit hard. Check the logs on both the sending console side and the app side and try to set breakpoints to see if any of them gets hit
@blancatrujillohigueras9865
@blancatrujillohigueras9865 2 жыл бұрын
Hi, good video, please do you know how to push notification from sql server remotly in xamrain form s?, i don t want with api.
@jfversluis
@jfversluis 2 жыл бұрын
To be honest I think it’s a good idea to add an api between your app and sql database for several reasons. And the ability to send push notifications is one of them. I don’t think there will be a video on sending notifications directly from sql server any time soon, sorry!
@hansleonhardt7653
@hansleonhardt7653 Жыл бұрын
Thank You... THAT helped. :)
@jfversluis
@jfversluis Жыл бұрын
Glad to hear it!
@astridgauthier8065
@astridgauthier8065 2 жыл бұрын
Good morning please I would like to know how to activate notifications when the user needs to send or receive the files as for example using a backup app. Please take into account my comment
@jfversluis
@jfversluis 2 жыл бұрын
Sorry I'm not sure what you mean. My videos show you how to implement the notifications, it's up to you to find the right point in your application flow when to actually trigger the notification depending on the action you would like your user to take :)
@hoaithanh8308
@hoaithanh8308 2 жыл бұрын
Can this code send notifications for ios? thanks
@jfversluis
@jfversluis 2 жыл бұрын
Absolutely!
@VuNguyen-bf7cj
@VuNguyen-bf7cj 2 жыл бұрын
Thank you for this video! Can you make a guide to send push to FCM and APNs via AWS with .Net core?
@jfversluis
@jfversluis 2 жыл бұрын
This video sends to FCM and APNS (through FCM) with .NET Core. I’m not really familiar with AWS so that will probably not happen anytime soon.
@madraven37
@madraven37 3 жыл бұрын
Finally!!! 🤩🤩🤩 A question, what do you suggest with the TOKEN? Do we have to save it on our database? And every time the users open the app, we'll have to update the token from there? I have a cloud-based application, I'm wondering if saving the token every time the user opens the app is right so that we can retrieve the token from our server and send it through that token..I hope I'm not confusing you..😁😁
@jfversluis
@jfversluis 3 жыл бұрын
There is an event when the token refreshes. You might want to send that token back to your backend to use!
@azmolazmol8121
@azmolazmol8121 2 жыл бұрын
Hello. Please show how you can send a push to an ios device in the same way. Thank you.
@jfversluis
@jfversluis 2 жыл бұрын
This should also send notifications to iOS devices!
@azmolazmol8121
@azmolazmol8121 2 жыл бұрын
@@jfversluis Thanks a lot! I have a question because I did not find the information. Is there a life cycle of tokens or is it unlimited? The problem is that it is sent to iphone 13, but not to an earlier version. Can you give me a hint where to dig?
@lenhat2863
@lenhat2863 3 жыл бұрын
i got an error on initialization.when using .net web.hope you can help me to develop HTTP API
@jfversluis
@jfversluis 3 жыл бұрын
Without any details it's impossible to tell what might be wrong, sorry. You might be better off asking on Stack Overflow or a similar site :)
@tagathangelou
@tagathangelou 3 жыл бұрын
Hi Gerald thanks for the great explanation!! A quick question, how do i return the token of the device so i will store it on database so i can send to a specific user/device a message if i want?
@jfversluis
@jfversluis 3 жыл бұрын
Instead of printing it to the Console.WriteLine like I do, send it back to the server you have in place :)
@tagathangelou
@tagathangelou 3 жыл бұрын
@@jfversluis sorry i cant read the code from the video
@jfversluis
@jfversluis 3 жыл бұрын
@@tagathangelou Good thing you don't have to. There is a link to the repo under each video!
@karanpreetsingh9934
@karanpreetsingh9934 2 жыл бұрын
You're videos are amazing, thanks for your efforts you have putted in. Can you please create a video on how to customize the notification
@themronion
@themronion 3 жыл бұрын
why not an async Task Main, Gerald?!!!) Looks like a .Result propaganda :D
@jfversluis
@jfversluis 3 жыл бұрын
I knowwwww! I already said it was dirty?! ;( But it's not possible yet with this version of .NET!
@josedonizeteoliveirajunior1744
@josedonizeteoliveirajunior1744 3 жыл бұрын
That's it dude, thanks for explaining every detail of the notifications.
@jfversluis
@jfversluis 3 жыл бұрын
I'm happy I finally did this! :D There is still much details I can go over, but at least the bare minimum is out there now :)
@willian-menezes
@willian-menezes 3 жыл бұрын
Hi Donizete...
@josedonizeteoliveirajunior1744
@josedonizeteoliveirajunior1744 3 жыл бұрын
@@willian-menezes hi brother! Kkk
@angelb.vasquez8981
@angelb.vasquez8981 2 жыл бұрын
WOW!! PERFECT. WOULD IT WORK IN MVVM?
@jfversluis
@jfversluis 2 жыл бұрын
Sure! Not all things here can be handled here with MVVM as you’re dealing with platform stuff but you using MVVM in this case shouldn’t matter
@angelb.vasquez8981
@angelb.vasquez8981 2 жыл бұрын
@@jfversluis I've been trying but it gives me an error when looking for the private_key.json, I don't know if I have to specify the path in another way
@jonasdachsteiner3535
@jonasdachsteiner3535 2 жыл бұрын
Thanks a lot for your videos. But I have one unanswered question and the internet gave no results so far. How do you send a pop up notification to an Android device via the API (not with the UI of FCM-Console)? It should be a minor change in the JSON because it works with the FCM-Console (like in your other video). Looking forward to a response and thank you! Greetings. (-:
@jfversluis
@jfversluis 2 жыл бұрын
I’m not sure if I understand. If you apply what you have seen in this video in your API project it should just work
@jonasdachsteiner3535
@jonasdachsteiner3535 2 жыл бұрын
@@jfversluis I mean how to archive a popup message when using the API with a post request. For example with Postman in json format.
@JoeBagodonuts7729
@JoeBagodonuts7729 2 жыл бұрын
When using FCM like this, I want to know how to elevate the IMPORTANCE of the push notification and to enable a default sound with the notification. Do you have a video that covers that?
@jfversluis
@jfversluis 2 жыл бұрын
Don't have a video about it, but you can set FirebasePushNotificationManager.DefaultNotificationChannelImportance in the Application.cs
@JoeBagodonuts7729
@JoeBagodonuts7729 2 жыл бұрын
@@jfversluis That'll be a start - I'll do it today. Thanks for all the help!
@interpreterdeveloping
@interpreterdeveloping 2 жыл бұрын
Thankssss sooo much🖤
@jfversluis
@jfversluis 2 жыл бұрын
You are very welcome! Glad it was helpful!
@youngcalabria6227
@youngcalabria6227 Жыл бұрын
The much painful part of coding is each time you struggle fixing bugs or finding solutions. Each time I search online and came across your videos I know that I finally found the solution and that my life is saved again and again... You may not know how much helpful you are, please know that you are the most helpful guy I found online during my last 15 years of coding! Thanks a billion
@jfversluis
@jfversluis Жыл бұрын
Wowowow you made my week! That is so very nice of you to say. Thank you for that. These are exactly the types of things that keep me going. Trying to help out wherever I can. Glad to hear that is working out, even long after I have posted this initially. Thank you my friend!
@robertocruz231
@robertocruz231 3 жыл бұрын
Great video, but I have a dude, how can send the notificatión to especific user or device? Thanks in advance
@jfversluis
@jfversluis 3 жыл бұрын
Save the token from the push notification and make sure you can link it to the user that it comes from, i.e. the logged in user in your app. Then you can send it to specific users!
@Vuyiswamb
@Vuyiswamb 2 жыл бұрын
Thanks for the Video, can you close the app and receive the message when the app is closed ?
@jfversluis
@jfversluis 2 жыл бұрын
Should be possible, yes
@Vuyiswamb
@Vuyiswamb 2 жыл бұрын
@@jfversluis Thank you .
@muhammadyaseen1418
@muhammadyaseen1418 3 жыл бұрын
I don't know what to say ....thx u sooooo much all your videos are clear and nice and very helpful as usule ....
@jfversluis
@jfversluis 3 жыл бұрын
No problem at all! Thanks for the kind words!
@stryder12345
@stryder12345 2 жыл бұрын
Guys, this method won't work on Android 12 , for fix this add in tag in AndriodManifest.xml
@jfversluis
@jfversluis 2 жыл бұрын
Thanks for letting us know!
@stryder12345
@stryder12345 2 жыл бұрын
@@jfversluis 😅
@luisantoniojachozambrano7605
@luisantoniojachozambrano7605 3 жыл бұрын
Thanks for these videos, Could you show how to do foreground FCM please..
@jfversluis
@jfversluis 3 жыл бұрын
What do you mean with foreground?
@TroutsWorld
@TroutsWorld 3 жыл бұрын
How do I get a token based on their username?
@jfversluis
@jfversluis 3 жыл бұрын
The tokens are very random and tied to the device and your app but can change over time. There are events that are raised when a new token is issued, send that back to the server including information what their username is or however else you identify users
@stefanocortesi4592
@stefanocortesi4592 3 жыл бұрын
how can i implement it in the splash screen class and not in the main activity? if I initialize it on the splash screen, the token is not generated
@jfversluis
@jfversluis 3 жыл бұрын
I'm sorry I don't understand your question, it seems to contradict each other :)
@hocvuinh9606
@hocvuinh9606 Жыл бұрын
Very good! great. Thank you very much.
@jfversluis
@jfversluis Жыл бұрын
You’re very welcome! Glad it was helpful!
@bobbybasak926
@bobbybasak926 3 жыл бұрын
FCM vs Azure Push Notifications? What are the tradeoffs? Thank you
@jfversluis
@jfversluis 3 жыл бұрын
Technically not much. Both solutions are kind of a layer on top of the native notifications. You will always have to go through the Apple and Google servers at the end. Of course FCM _is_ the native platform to do this for Android. So the only thing I could think of is that FCM has functionalities that are not surfaced through Azure Push Notifications. Does that makes sense? :)
@bobbybasak926
@bobbybasak926 3 жыл бұрын
@@jfversluis Makes sense. There is a nominal cost for Azure Notifications Hub at a certain threshold level. Thank you for your excellent content!
@abdulrahmanelheyb
@abdulrahmanelheyb 3 жыл бұрын
Can help i get this error : "FirebaseMessagingException: SenderId mismatch" in c#
@jfversluis
@jfversluis 3 жыл бұрын
No clue, sorry :) but sounds like some ids are not lining up?
@abdulrahmanelheyb
@abdulrahmanelheyb 3 жыл бұрын
@@jfversluis I followed all you steps but I get onyl this error i researching on stackoverflow and medium etc. but I cant find good result anyway I keeping researching again thanks so much bro 🤗
@ahmedmohamed-vh5ce
@ahmedmohamed-vh5ce Жыл бұрын
did you find the solution ?
@jordig3412
@jordig3412 3 жыл бұрын
great video summary, and great explanations ;-)
@jfversluis
@jfversluis 3 жыл бұрын
Woohoo thanks!
@AMIRKHAN-dm2fm
@AMIRKHAN-dm2fm 3 жыл бұрын
Can you please make a tutorial on how to convert existing balzor web assembly project to asp.net core hosted app if we have separate api project.
@jfversluis
@jfversluis 3 жыл бұрын
Sorry, I'm not sure what you mean with this :) You already have a Blazor WebAssembly project? And you want to convert that?
@AMIRKHAN-dm2fm
@AMIRKHAN-dm2fm 3 жыл бұрын
@@jfversluis yes have a separate blazor wasm project and a separate asp.net core Api project. and when we create new wasm project using visual studio there is a check box called asp.net core hosted by check this checkbox vs create three projects for us one is client other is server and the third one is shared.in my case when i start developing my blazor project i have no idea about aso.net core hosted so i create separate project for wasm and separate api project as i mentioned above.but now when i want to deploye my app on server i need two different websites for hosting two projects one for api and other for client app.by using asp.net core hosted i just have to use one website.so please guid me to turn my app at this stage to asp.net core hosted Thanks.
@MichaeldeGans
@MichaeldeGans 3 жыл бұрын
Thanks Gerald, came at the right time! Life saver!
@jfversluis
@jfversluis 3 жыл бұрын
I can read minds, watch out!
@TroutsWorld
@TroutsWorld 3 жыл бұрын
Is there a way to run the ".Send" Console app when you push a button In the main project? Or would I just add the code as a function in the main project?
@jfversluis
@jfversluis 3 жыл бұрын
From the app you mean? I wouldn't recommend sending notifications from the app directly. You'll probably always send also something to your backend service, add a trigger there to send the push notification
@TroutsWorld
@TroutsWorld 3 жыл бұрын
@@jfversluis Sorry I'm still kinda confused.... In my code I send the token to my firebase database along with a username to idenify which phone is which. When I add information about a specific user, I want that user to get a notifcation letting them know that information has been added... So instead of fetching that users token and adding it to "XFFCMPushNotificationsSample.Send" and running it, I would add a trigger through firebase and send it that way?
@jfversluis
@jfversluis 3 жыл бұрын
@@TroutsWorld It all depends on how and when you want to send it. If you want to let them know the information was added, then yes, if would make sense to trigger a piece of code from the server whenever that happens. Although, personally I feel using a push notification for that feels a bit too much. You have to be careful with push notifications to not annoy people. In this case why not just inspect the HTTP result code and let the user know based on that if the operation succeeded or not?
@TroutsWorld
@TroutsWorld 3 жыл бұрын
@@jfversluis Yea you're right. Thank you very much. You really help me out a lot.
@jfversluis
@jfversluis 3 жыл бұрын
Awesome! Glad to be of service :)
@eddienoureddine7408
@eddienoureddine7408 3 жыл бұрын
Thumbs up for the video , another one for the T-Shirt. I looked it up everywhere online but could not find it :)? Would you share where I can buy it from ?
@jfversluis
@jfversluis 3 жыл бұрын
Thanks! You mean this one? www.bonfire.com/store/dotnet-maui/
@eddienoureddine7408
@eddienoureddine7408 3 жыл бұрын
The one you were wearing in this specific video
@jfversluis
@jfversluis 3 жыл бұрын
Aah sorry! Gotcha. That one is here: microsoftmerchandise.com/Shop/#/product/Apparel/Tops/MIC01122602-Binary-T-shirt-Charcoal-SM
@dummyaccount9578
@dummyaccount9578 2 жыл бұрын
how can you show a banner or box on notification?
@jfversluis
@jfversluis 2 жыл бұрын
Set a higher priority
@MahmoudMouradSidky
@MahmoudMouradSidky Жыл бұрын
Thank you this saved me a lot of time
@jfversluis
@jfversluis Жыл бұрын
That’s the goal! Glad it was useful!
@8pplgr
@8pplgr 3 жыл бұрын
superb video Gerald. it helped me a lot to set up the whole environment for my app.
@jfversluis
@jfversluis 3 жыл бұрын
Great to hear!
@samialfarra4275
@samialfarra4275 3 жыл бұрын
thank you so much . i want ask question what is better senario used for send notification for each user that message different from each other make a topic for each user is that right ?
@jfversluis
@jfversluis 3 жыл бұрын
It really depends on your scenario :) Topics are more suitable to grouping people that might be interested in a certain type of notification. For example: when there is breaking news. But if you want to build a chat app then you might want to send a notification to a specific token. Unless, you will have a group chat, then you want to have those users in that group to be in a topic and send the notification to that... Does that make sense? :D
@samialfarra4275
@samialfarra4275 3 жыл бұрын
yes thank you . so i need save a token for each user in sql server database when he open app at first time . and the admin later can send notification for each user .?
@gamerparttimee
@gamerparttimee 2 жыл бұрын
but sir, where can i get the registrationToken ?
@jfversluis
@jfversluis 2 жыл бұрын
That’s provided by Google. I show in the video how you get it
@gamerparttimee
@gamerparttimee 2 жыл бұрын
@@jfversluis thank you sir, your video save my life
@stryder12345
@stryder12345 2 жыл бұрын
Is this must push message to multiple xamarin apps?
@jfversluis
@jfversluis 2 жыл бұрын
Sorry, I’m not sure if I understand
@stryder12345
@stryder12345 2 жыл бұрын
@@jfversluis i created app with xamarin , and implement push notification with FCM by your lesson for android , now i installed it to 3 android phones, but only 1 receive push notification
@stryder12345
@stryder12345 2 жыл бұрын
@@jfversluis And so i asked question: "Is this method must send notification for all phones with my app?"
@stryder12345
@stryder12345 2 жыл бұрын
@@jfversluis sorry it doesn't work only with android 12...
@jfversluis
@jfversluis 2 жыл бұрын
If you want to send 1 notification to all your users at once you probably want to let them subscribe to a topic instead of looping through all tokens
@cissemy
@cissemy 2 жыл бұрын
Thanks is there any way to send a custom sound ?
@jfversluis
@jfversluis 2 жыл бұрын
You absolutely can. I think it does require some configuration upfront, for instance: put the custom sound in your app. Don't know from the top of my head how to do it exactly though
@cissemy
@cissemy 2 жыл бұрын
@@jfversluis Do you have any documentation ?
@aliizadyar4602
@aliizadyar4602 2 жыл бұрын
Best tutorial👍
@jfversluis
@jfversluis 2 жыл бұрын
Glad you liked it!
@mohammadradwan752
@mohammadradwan752 3 жыл бұрын
Gerald . You are a hero You are really generous. Your videos helped me a lot. Big thank you.. I have a question.. If I'm to use this appraoch as an API what would be the correct verb. Put or Get
@jfversluis
@jfversluis 3 жыл бұрын
Thank you Mohammad! Appreciate it! My suggestion would actually be to use a POST :D
@mohammadradwan752
@mohammadradwan752 3 жыл бұрын
@@jfversluis Couldn't agree more ❤️
@mohammadradwan752
@mohammadradwan752 3 жыл бұрын
@@jfversluis I used the same code but with a tiny modification, and it worked in Xamarin.Forms like a charm, thanks to you Mr. my dream has come true, and now I'm able to send cross-platform notifications i.e from Desktop to Android and vice versa. The modification I made is: instead of getting the credentials from the .json file, I used the 'fromStream' method, and that of course, after imbedding the .json file as a resource in the shared project. Thanks a lot Mr. Gerald
@jfversluis
@jfversluis 3 жыл бұрын
That is so wonderful to read Mohammad! Thank you for taking the time to let me know! Good luck with your app!
@mohammadradwan752
@mohammadradwan752 3 жыл бұрын
@@jfversluis I'm actually thinking of coding a nuget package for both Xamarin.Forms and Desktop for that. and the credit will be yours for sure.
@josiahtmahachi7291
@josiahtmahachi7291 3 жыл бұрын
Thank you for the tutorial.
@jfversluis
@jfversluis 3 жыл бұрын
My pleasure! It was fun to do a couple of videos on the same topic and create sort of a course :)
@esmail9189
@esmail9189 3 жыл бұрын
Thanks a lot
@jfversluis
@jfversluis 3 жыл бұрын
You’re welcome!
@SLNakaSiLeNT
@SLNakaSiLeNT 3 жыл бұрын
Thanks for explaining how it works! Unfortunately I can't get a handle on the foreground notifications. How to send them when the program is open? Maybe some follow-up video?
@jfversluis
@jfversluis 3 жыл бұрын
Have you seen the iOS video? I think I mention it there
@SLNakaSiLeNT
@SLNakaSiLeNT 3 жыл бұрын
@@jfversluis ok, i'll check. Thanks!
@simseyha
@simseyha 3 жыл бұрын
Thank bro
@simseyha
@simseyha 3 жыл бұрын
According to your post I can implement my first app with notification :D
@jfversluis
@jfversluis 3 жыл бұрын
Woohoo! My pleasure!
How Do Push Notifications Work?
8:42
Gerald Versluis
Рет қаралды 22 М.
Implement Push Notifications with Xamarin.Forms (iOS) and FCM
27:05
Gerald Versluis
Рет қаралды 27 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 117 МЛН
Local Push Notifications with .NET MAUI, Easy With This Plugin!
17:29
Gerald Versluis
Рет қаралды 34 М.
How to Implement Firebase Push Notifications on Android (FCM + Backend)
1:06:31
📱Android Push Notifications • Flutter x Firebase Tutorial
12:39
Real-Time Notifications Using Blazor and SignalR from scratch
19:43
Milan Jovanović
Рет қаралды 34 М.
Implement Push Notification In .NET MAUI (Android)
40:23
Programming With Pragnesh
Рет қаралды 29 М.
Firebase Cloud Messaging API (v1) Tutorial
9:13
Native Notify
Рет қаралды 79 М.