Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local Notifications with Xamarin Forms?

I am learning how to use Xamarin forms and I want to implement (push) notifications on Xamarin Forms. I have googled but to no avail. Does anyone know how to implement Local/Push notifications with Xamarin Forms? I am going to use an actual server at a later date but for now just showing a notification when I, for example, press a button, is totally OK for me.

Thanks for your help!

edit:

I am now using the DependencyService to access the Device OS's notification system instead of trying to use Xamarin Forms itself. Answers on this question are not necessary anymore!

like image 413
S. ten Brinke Avatar asked Sep 15 '15 13:09

S. ten Brinke


People also ask

How do I send a local alert with a repeat interval?

In models, we need to create the below class with Title, Body, ID, IconId and NotifyTime. It will be useful to pass a local notification data to BroadcastReceiver receiver for repeating in Android. Create a class LocalNotificationService and we need to implement LocalNotification and Cancel methods like below.

What is local notification in iOS?

Local notifications reach users whether your app is running in the foreground or the background and require no external infrastructure to send, which is why they are aptly termed “local.” These notifications simply require that a user's device is on in order to be received.


3 Answers

Xamarin's documentation includes a guide to notifications:

https://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/

It covers both local and remote notifications, including recommendations for libraries (e.g., PushSharp, UrbanAirship) to handle sending push notifications.

like image 136
Joel Anair Avatar answered Sep 21 '22 22:09

Joel Anair


You can use https://www.nuget.org/packages/Xam.Plugins.Notifier plugin for local notifications. This is one of the best plugin I've used with Xamarin Forms.

like image 25
Daxa Varsani Avatar answered Sep 17 '22 22:09

Daxa Varsani


You can also try local notification plug-in for Xamarin Forms https://www.nuget.org/packages/Plugin.LocalNotification/. It has more features and look at the source code if you are implementing your own version.

like image 36
Tharindu Thudugala Avatar answered Sep 19 '22 22:09

Tharindu Thudugala