Local Push Notifications with .NET MAUI, Easy With This Plugin!
Ғылым және технология
With the Plugin.LocalNotification for .NET MAUI, adding local push notifications to your app has never been easier. In this video I will show you how to get started and we see the tip of the iceberg of the gazillion options this plugin has, don't miss it!
💝 Join this channel to get access to perks:
kzread.info/dron/ral.html...
🛑 Don't forget to subscribe to my channel for more cool content: kzread.info...
🔗 Links
Sample code repo: github.com/jfversluis/MauiLoc...
.NET MAUI Docs: docs.microsoft.com/dotnet/maui
⏱ Timestamps
0:00 Local Push Notifications for .NET MAUI
0:15 What Are Local Push Notifications?
1:19 About Plugin.LocalNotification
2:17 Install NuGet & Initialize
3:45 Implement Local Notifications
11:49 Android Demo
13:05 Notification Events
15:39 What Do You Want to Learn Next?
🎥 Video edited with Camtasia (ref): techsmith.z6rjha.net/AJoeD
🙋♂️ Also find my...
Blog: blog.verslu.is
Twitch: / jfversluis
All the rest: jfversluis.dev
#maui #notifications #pushnotifications #dotnet #dotnetmaui
Пікірлер: 202
This is just one of the many amazing plugins that are available for .NET MAUI, want to learn about the rest? Check out this curated playlist right here 👉 kzread.info/dash/bejne/oHeCypuAXbScaJs.html
@CoderboyPB
Жыл бұрын
Bedankt! Would be very thankful to see a video update for MAUI about 'normal' push notifications as well 🙂
@jfversluis
Жыл бұрын
@@CoderboyPB I definitely want to do that, but that is MUCH more complicated :D stay tuned!
@kanaalmarc
Жыл бұрын
@@jfversluis Da's ook een wens van mij; aannemende dat het over remote notificaties gaat. Als het moet via Firebase, maar het liefst via een eigen .NET Core web server.
@jfversluis
Жыл бұрын
@@kanaalmarc Je kunt nooit push notifications sturen vanuit alleen je .NET Core web server. Je zult altijd via de servers van Apple en Google moeten gaan, zie: kzread.info/dash/bejne/c3-Nx8Sqf6anqrw.html Het signaal om een notificatie te versturen kan natuurlijk uit je .NET Core web server komen. Dat gezegd hebbende, ik wil nog een aantal videos maken over push notificaties van remote voor .NET MAUI
@kanaalmarc
Жыл бұрын
@@jfversluis Ja dat bedoelde ik ook: initiëren vanuit eigen (hosted) web server. Ik weet dat, voor beveiliging, altijd Apple en Google er tussen zitten. Ik heb in mijn XF tijd ook met lokale notificaties gewerkt. Op iOS werkt dat niet, omdat Apple begrijpelijkerwijs geen echte achtergrond processen toestaat. Je hebt alleen de functionaliteit voor op de achtergrond verversen, en de frequentie wordt bepaald door iOS a.h.v. het app gebruik. Vandaar ook mijn wens om met push notificaties te werken. Afijn, ik wacht je videos met belangstelling af.
Hey, Gerald! I'm watching all of your new videos, thank you for sharing them!!! Please, could you talk about internationalization and themes (for user interface) in MAUI? Cheers!
We are waiting for your videos because they are always useful and interesting
@jfversluis
Жыл бұрын
Thank you so much Anwar!
Another fine video Gerald! Thank you for sharing!
@jfversluis
Жыл бұрын
Many thanks Jonathan, appreciate it!
I don't know if I'm missing something but I really need some form of documentation of how to set settings or even find the NotificationRequest by the NotificationId or even add buttons as you say to let the user interact with the notification. I've searched through GitHub and NuGet but can't seem to find anything about these things. Really nice job though and exactly what I need. :)
If you don’t get this regularly, but thank you man. I appreciate your tutorials so much.
@jfversluis
6 ай бұрын
I try! Thanks for the kind words!
Hey Gerald. Thanks for this very informative video. At 14:10, you mention action buttons on notifications. Could you possibly link me some documentation on how to do this or make a video about that as you suggested? :) That would be awesome
Exactly what I needed! Thank you for this tutorial.
Hello, does anyone know how to set an Icon on IOs? I've already set Custom icon on Android but i dont seem to find how to set custom icon for IOs
Thanks for this video. I am new to MAUI, right now my struggle is how to have notification to windows app. Is there a way to do it in MAUI?
How do I set a reminder by selecting start date and enddate and time using mvvm and be notified for example appointment reminder
Great video, just in time for a project I'm working on! I'm wondering if it's possible to make a popup notification "stick", similar to that of a timer that has run out. I've tried with the different category types but to no avail...
@jfversluis
Жыл бұрын
On iOS that is not really possible. The trick for that is to add a custom sound to the notification. The sound can be at most 30 seconds and the banner will then keep showing for 30 seconds. Not sure about Android, maybe it works the same.
Hey Gerald, thank you for your Video! For some reason it doesn't work for me... do I have to check any settings in the emulator or something like that? Thanks in advance!
Hello Gerald Im trying to make push notification service on maui .net 8.0 but firebase packages not supported what can i do or is there any other way to make it
Hello Gerald, thank you for sharing yours videos 👍
@jfversluis
Жыл бұрын
Appreciate it, thanks!
Hi, I am working on a project in which I send a notification for each message i receive from an amazon sqs. The problem I am facing using this plugin is that even if I group notification as the documentation says, every new notification message "cancel" the previous one. Can someone help me?😅
Thanks for the video. Can you mention an example on how we can schedule the notification in .NET Maui? i.e check every hour if user did this, otw create a notification
You are a lifesaver, thank you so much!
@jfversluis
Жыл бұрын
You’re welcome!
Great tutorial however, how can the notification shows in the top? So the usr doesnt need to swipe the notification center to see the notifications?
Hi i have a doubt. In this push notification, how to set a navigate particular area My english is bad, i hope you understand what i say
Yo!!! You are a life saver man. Thank you!!!
@jfversluis
8 ай бұрын
Appreciate it thank you!
I am getting error Show: Notifications are disabled , any suggestion on this.
Gerald, with reference to a number of questions could you please demo how to trigger a notification when the app is closed. You say it should work but no one seems to be able to make this happen.
Thank you, please tutorial how to combine this with MVVM
Great tutorial but can you help me for How can I do When i click on the notification, a specific page opens maui Thank you
Thanks for letting us know
@jfversluis
Жыл бұрын
My pleasure!
Great tutorial! Can the notification icon be really customized? Mostly all apps on Android 12 (even professional apps) show this "empty-icon" on notifications!
@jfversluis
Жыл бұрын
Oh really?! I'm more of an iOS person, I totally assumed that that would be something you could do 😅 I need to look into that then... What good does it to when it only shows you 10 circles in a row?
How do i add an image? Can't get it to work
Nice Video thank you. For a shopping app, if users favorite items prices drops down I want to send local push notification. Any recommendation how to do it?
@pattypeppermint3753
8 ай бұрын
event
Hello Gerald, thank you for the helpful video! Could you create a tutorial on implementing background local notifications? I aim to display upload and download progress even when the app is in the background.
great video thanks for the guidance it works well but I have an issue in my use case that has a web API that returns a number of devices getting overheated whenever the API returns the data at all times. I need to send a notification to the app user even if the app is closed.
@jfversluis
5 ай бұрын
For that you probably want to look into remote push notifications
Great video thanks, do you know if I can use notifications without using Azure and use my local apache server instead? Need to check your recent videos as need to convert my app from xamarin I'm sure you have one :)
@jfversluis
Жыл бұрын
Thank you! For local notifications you don’t need Azure or anything. For remote push notifications you will always have to go through the servers of Apple and Google. Your Apache server can be the one to initiate a push notification, but it can’t send it to devices directly. See: kzread.info/dash/bejne/c3-Nx8Sqf6anqrw.html
Could I use this to show a media player UI in the notification center or should I be doing things differently
@jfversluis
Жыл бұрын
Eventually I definitely want to add that. This is not implemented today.
Is there any limit to icon size for notifications? I tried using the main logo file in svg format but that didn't work when the notification was scheduled for after a day. I tried removing the logo attributes, that worked but now there is empty box in status bar for the notification. Any idea?
@salvcri
10 ай бұрын
Excuse me but what .net version are you using?
Thanks, Gerald, for the great videos. I am working on an app where the user should be able to set reminders for a specific date, with a message, and receive notifications of those reminders at the scheduled date even if the app is not running. I think that push notifications is the way to go to achieve this. The tutorials I watched so far regarding push notifications, describe a concept where a push notification is send from the Firebase console to the device which is not what I want. How can I achieve this kind of functionality? Any advice to which direction to look at, will be greatly appreciated. Kind regards, George 😀
@jfversluis
Жыл бұрын
Hey George! Thank you for watching! If your use-case is reminders it’s probably better to use local push notifications. Then there is no need to have any timer code on your side and more importantly the reminder will still honor when the users device is offline or your server is down. If you still want to do it server-side, your code will probably be something like in the video: kzread.info/dash/bejne/iH1l2cmem92birA.html You will want to have an Azure Function maybe with a cron trigger, retrieve the reminder from the database and send it such code like that. Hope this helps!
@georgemantarakis3410
Жыл бұрын
@@jfversluis Hey Gerald 😀, Many thanks for taking the time to respond. What I had in mind was Cloud Firestore for the database and Cloud Function to retrieve the reminder from the database, but I wasn't sure if this is the correct approach. The video is great and sheds a lot of light. I have some (I guess a lot) work to do to achieve this. Many thanks again for your help, Kind regards, George
@jfversluis
Жыл бұрын
No problem at all! Anything for my most loyal watchers 😉 Yeah sure if you want to stick with Firebase I’m sure they have some serverless/cron functionality as well so you can substitute any technology there. But the general idea stays the same
Gerald, love the NotificationId 🐐
@jfversluis
Жыл бұрын
Gotta keep it nerdy 🤓
Thanks. For a future video, I would love to see an example of the new Maui .NET7 RC1 new X/Y position* Width/Height* Minimum Width/Height Maximum Width/Height SizeChanged Features on Windows. I have not seen a working example of this so far. Thanks for your helpful videos.
@jfversluis
Жыл бұрын
I'm planning some desktop videos in the near future so will see to include this, thanks!
Great video, does anyone know if its possible to show the notifications even when the app has been completely closed?
@jfversluis
Жыл бұрын
That should work all the same, if not, check the plugin repo
Thanks for this. Is there any way it would be possible to get a local notification to fire based on user location, to tell them they are near a point of interest? Any ideas?
@jfversluis
Жыл бұрын
Yep! All in the docs 😉 github.com/thudugala/Plugin.LocalNotification/wiki/Location-Notifications
@deanbullen9021
Жыл бұрын
@@jfversluis That's great - thank you!
Hi Gerald, I have problems with notification push with your example, doesn´nt show it en my mobile, could you tell me what i have to revise?
@jfversluis
Жыл бұрын
I don’t have enough any info for that to solve this for you, sorry!
Thank you !
@jfversluis
2 ай бұрын
You're very welcome!
Hello thanks! Great video. Does this work also in MAUI Blazor?
@jfversluis
Жыл бұрын
It definitely should yes
Is this also work for WinUI?
What would happen if the app is closed at the schedule time to send the notification? Is the notification still sent. Trying to research tech for sending notifications and these seems easy. Just curious on limitations before trying it out.
@jfversluis
Жыл бұрын
It definitely should. It schedules it in the OS push notification system which is independent of the app running or not
great video ! but the video is not working on IOs are there any permissions that need to be added platform specifically , I am working with Dot Net 7 with Dot Net Maui Blazor
@jfversluis
Жыл бұрын
Check the repo if there are maybe some changes by now
@Neha-lh6ok
Жыл бұрын
@@jfversluis i have just downloaded the code its not working on ios yet
Hi, great video! How can I change the color of the notification?
@jfversluis
Жыл бұрын
Thanks! If that is possible on the operating system then it’s probably possible here. For iOS for instance that’s not possible. Don’t know about Android
Hi Gerald, Thanks for all awesome videos. using System.Data.SqlClient; not working in .NET MAUI for net6.0-android. Would you consider doing a video on sql connection for .net maui.
@jfversluis
Жыл бұрын
Personally I think you shouldn’t connect a mobile app directly to SQL server. Add a REST API in between! Thanks for the kind words
I like the video. Instructions are easy to follow. But not resulting in any notifications on IOS for me - code runs without exceptions but nothing shows. iPhone 13 installed via Hot Restart from VS 2022 17.8.2. .Net 8 MAUI project. Plugin.LocalNotification 10.1.8, also tried 11.0.1.preview01 with same result. builder is calling UseLocalNotification. Any ideas?
@bneedels
7 ай бұрын
var enabled = await LocalNotificationCenter.Current.AreNotificationsEnabled(); indicates Notifications are Not enabled. How to enable them? I tried setting Info.plist to Enable Background Modes so that Remote notifications are turned on, without result.
I was playing around with it and it works fine on android. Just I couldnt figure it out how to add Images/Icons to the notifications ?
@Lanthiren
Жыл бұрын
You can't
Hey Gerald, thx again for your new video. Can you make a video Programmatically Connecting to specified WiFi in a MAUI app. Or give a suggestion where I can find a solution. I try to create an app that connects with a device with its own WiFi and read some data. 🙂 Thanks
@jfversluis
Жыл бұрын
Hmm interesting case. For iOS, Android? Both? If you can find the code how to do it natively you should be able to relatively easily translate that into .NET MAUI. Did you find anything about that? If so and you can't figure it out, shoot me an email and I can have a look!
Hey boss! is there a video for Server side push notification in MAUI? Thank you
@jfversluis
22 күн бұрын
Not yet hopefully soon! I’m working on it
Awesome 👍
@jfversluis
Жыл бұрын
Thanks!
I am in trouble when I implementing push notification in my dot net core 7 Maui project . I want to implement this without xamrain packages.also I have issue plugin.firebase not compatible with my dot net core 7 Maui app for android and iOS . Can you please help me in this issue
@jfversluis
Ай бұрын
You might want to check this: github.com/AdamEssenmacher/GoogleApisForiOSComponents
I created a notification request. which pops up a notification every 30 mins. How do i stop it displaying it notification or how do i cancel schedule. cancel or cancellAll is not working for me. Thanks. :(
@jfversluis
Жыл бұрын
I think you have to save the notification ID and update it with a scheduled date in the past
Awesome video, does the shedule still works when the Application is stopped?
@jfversluis
Жыл бұрын
Yes!
@jonathanharmon3472
Жыл бұрын
@@jfversluis This answered a question I didn't even know I wanted to ask! I was going to research how to do notifications while my app wasn't running, now I don't! Awesome stuff!!
Coo. It does not seem to send notifications when app is closed though, any way to make it so?
@jfversluis
Жыл бұрын
It definitely should. Check the plug-in repo
This work if app is closed? I mean make a trigger came from server and app just run it
@jfversluis
Жыл бұрын
Should work!
Hi Gerald, Thanks for all the great content! 👍 I have tried a couple of push notification samples for Maui using Firebase, but they don't compile with the latest version of Visual Studio. Could you make a video on that?
Amazing! what about a tutorial for firebase remote config (both forms and maui)? thanks
@jfversluis
Жыл бұрын
Thanks friend! I’m not sure if i will get to that anytime soon, and I don’t think there will be a lot of Xamarin.Forms content still coming :)
Thank you for this Gerald! Awesome as always. Tried it and works fine in Android. What is the work around for iOS?
@jfversluis
Жыл бұрын
Thanks! Why need a workaround for iOS? For what?
@josephalulod7990
Жыл бұрын
@@jfversluis the notification isn't showing in iOS, and the app actually also doesn't show in the notifications setting. I'm thinking that maybe I'm supposed to address the "permissions"? like you mentioned at the first 2 mins?
@jfversluis
Жыл бұрын
If the app doesn’t pop a dialog to prompt the user if notifications are allowed then that’s definitely it
@josephalulod7990
Жыл бұрын
@@jfversluis I have a two-parter, first is, i just want to confirm, you mean the "Permissions" discussed in this video kzread.info/dash/bejne/a3ugzMmwltPPmag.html&ab_channel=JamesMontemagno, right? 2nd question, I am encountering a bug in the NotificationActionEventArgs IsTapped property, it is being executed twice and changes the value of the condition of my if statement inside it.
Please do a video about Adding action buttons to Notification
Kijkend naar de huidige staat van de plugin (zie issues op GitHub), lijkt deze nog steeds niet heel betrouwbaar helaas.
Hello, what about asking for permissions on Android? When I run it on IOS, system asks me for permission so I can grant it. On android its not doing that. I have added permission to Manifest file, but I still have to turn on notification permission manually in system settings for my app.
@jfversluis
Жыл бұрын
Have a look at the code for the plugin to see if it’s actually supposed to do that and open an issue on the repo if you think there is a bug!
@Criss129
Жыл бұрын
It probably shouldn't but maybe you know the way to do it? Cause its not on the list of class "Permissions".
@jfversluis
Жыл бұрын
The permissions API is very extensible, look it up in the Permissions Docs :)
I had a problem , without an error notifications didn't appear. I have tried on previous android version ( android 10 , api 29) and it worked.
@jfversluis
Жыл бұрын
Check the project repository if there is an issue or solution
Gerald, could you please make the video - How to handle firebase push notifications on MAUI. Also interesting to do it under .NET 8.0... Since, I dont know why but I couldnt find the nuget package which is compatible with MAUI .NET 8... Did you try it? Thanks for your channel!
@Quebster
6 ай бұрын
This... all the Firebase docs / tutorials need some fresh reworks for .NET 8+ MAUI.
@jfversluis
6 ай бұрын
Firebase is a product from a competitor. I doubt there will be official docs for it 😄 the NuGet should automatically be compatible with .NET 8. I am working on push notifications but it will probably will be with Azure Notification Hub
Thanks :)
@jfversluis
Жыл бұрын
Oh no thank you for your support!
I love .net Maui so much
@jfversluis
6 ай бұрын
Glad to hear that!
Hi Gerald. i have a problem.. IOS on notificationreceived not working.? can you. help me.. using xamarin forms
@jfversluis
Жыл бұрын
It’s near impossible to say anything useful about this without any more information, sorry!
@serdarpinar6186
Жыл бұрын
@@jfversluis Hi again.. notification succeccfully working but when ontapped on ios then not received any data. but android working properly. LocalNotificationCenter.Current.NotificationActionTapped += Current_NotificationActionTapped; not working on ios. thank you
Hi, can the notification be fired when when the App is closed e.g. 24 hours after it is set? Also can the notification be retained when the App is closed?
@jfversluis
Жыл бұрын
That should both be possible absolutely
@glenntaylor7143
Жыл бұрын
@@jfversluis Hi, cant' find how to do this in documentation and which ever way I try can't get this to work. How do you ensure the notification will fire after the App s closed? i.e the equivalent of the Android Alarm Manager SetExact and AllowWhileIdle.
@luisjjjj
Жыл бұрын
@@glenntaylor7143 Hi, did you find a solution to fire notifications when app is closed?
@glenntaylor7143
Жыл бұрын
@@luisjjjj Hi, apart from 'this should be possible' I have not found a solution. Reply to a simi;ar question was 'it should'. If this is the case I would like to see a demo.
Hi I am try to push Notification in Blazor MAUI but its not working. my android version is 13 API33 Build successful, there is no Error is showing but still not working NotificationCenter.Current.Show(Request); this Getting false
@ShinkuRaj-ji8nc
Жыл бұрын
Issue Solved add in AndroidManifest.xml
How to show notifications when is turned off application
How do I set notification without button? I want to set notification at a specific time
@jfversluis
Жыл бұрын
Use the Schedule property
Thank you for sharing this amazing .Net Maui Plugin ,, I have quotation it is possible to send notification using multi language ,, thank you again have great day
@jfversluis
Жыл бұрын
You can use localized resources as string so that should definitely be possible :) Thanks for watching!
@mohammedalsabahii2
Жыл бұрын
@@jfversluis I will try thank you
is there any other plugin to send notifications to devices not locally
@jfversluis
9 ай бұрын
Yep, check my videos about push notifications
Hello Gerald, Not getting any notification on android 13. I understand it needs some permission. Would you be able to help me on this?
@jfversluis
Жыл бұрын
Check the plugin repository:)
@anandshindey
Жыл бұрын
Unable to comment. Have trouble with my account.
@anandshindey
Жыл бұрын
for solution, see issue no 346 in the plugin repository
@anandshindey
Жыл бұрын
Unable to comment
@anandshindey
Жыл бұрын
@Marc Majors Happy to help
Great video. can you also do a video on how to sign in using a google account in MAUI ? Thanks in advanced
@jfversluis
Жыл бұрын
Maybe! I'm not great with auth... I'll see what I can do!
@ErwinEchon
Жыл бұрын
@@jfversluis Thank you in advanced
will it be pushed when app is not open like we do with google firebase
@jfversluis
2 ай бұрын
It should, yes
@BilalIjaz-fi9hn
2 ай бұрын
@@jfversluis which i should use. this plugin or google firebase for push notification
Is that plugin compatible with .net 8?
@jfversluis
6 ай бұрын
Check the repo. If it works with .NET 6/7 there is a high probability it will work with 8
how do you set a custom sound when notification is sent?
@jfversluis
Жыл бұрын
I think that’s in the documentation on the repo
@doctorj1607
Жыл бұрын
@@jfversluis thanks for the reply. i am using firebase, spaciffically with local notifications plugin. it all seems to work well to get the notifications and showing them, so thank you for the video,. but when it comes to set sound it doesn't seem to work when the app is stopped. The sound defaults. to system standers. This seems much more complex, than first expected now i have looked into it.
@doctorj1607
Жыл бұрын
@@jfversluis when i set the channel using android.channelId. the test device creates a new channel (general, micellanous) not sure what is heppening here.
@doctorj1607
Жыл бұрын
@@jfversluis Hi, it looks like it is using the default channel name not the name set by the user.
Can You please put a video based on touch effects button in maui?
@jfversluis
Жыл бұрын
I'm not sure what you mean with based on touch effects button?
@helloeveryoneb5996
Жыл бұрын
@@jfversluis s bro based on touch effects on button and if a button is selected it has to be highlighted like that...
This does not work with .Net 8 , when app is in background
Seems that this plugin does not work for .NET 8 :(
@SamuelSidor
4 ай бұрын
it does
Please Make a video with firebase notification FCM in MAUI
@Gerald please make the video on IOS part especially address the issue of Permissions to get Local Notifications working 🙏
@lexusprogrammer4515
Жыл бұрын
Never mind, I figured it out. 🕺
@jfversluis
Жыл бұрын
You, my friend, are amazing! Well done!
@verjanvargasfernandojulian8395
Жыл бұрын
@@lexusprogrammer4515 Hello!! im Having this trouble and i dont seem to find how to ask permission on IOs, can i get a Quick tip on how to do this?
@VICTORHERNANDEZ-on6uk
Жыл бұрын
What was the solution? Im facing the same issue it doesn't work on iOS
Awesome.. Please make video for Google and Microsoft SSO.. Thanks
@jfversluis
Жыл бұрын
Thanks! I'll see what I can do!
for ios?
@jfversluis
10 ай бұрын
Yep
You are my man! The implementation now is not even worth talking about :D
@jfversluis
Жыл бұрын
Perfect!
nicce
@jfversluis
Жыл бұрын
Thanks!
It's not working for me :/
@jfversluis
9 ай бұрын
If you want me to give you some kind of hint I will need more than "it's not working" 😄
Great video! Just sharing what I found to make it work on Android github.com/thudugala/Plugin.LocalNotification/wiki/1.-Usage-10.0.0--.Net-MAUI
@jfversluis
11 ай бұрын
Perfect, thanks for sharing!
I had this working fine back in April, then it stopped working. Had to add new permissions for Android > 30, in order to use the schedule feature android.permission.SCHEDULE_EXACT_ALARM android.permission.USE_EXACT_ALARM Hope this helps someone else using this plugin!
@LuBuuuH
9 ай бұрын
Thank you so much! You saved me bro
@DeadDemosthenes
6 ай бұрын
Hey, i was going in circles. This fixed it for me too! @jfversluis, Add this to your description for those trying to schedule alarms
@jfversluis this code not working with iOS?
@jfversluis
6 ай бұрын
It should! Check the repo for any issues or things you need to configure
just done a similar App, nothing was working until I've added the following permission in the android manifest
@jfversluis
Жыл бұрын
Thanks for letting us know!
Awesome 👍
@jfversluis
Жыл бұрын
Thank you! Cheers!