Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Local Notification not displayed when app is closed

DeepakDeepsDeepakDeeps INMember ✭✭✭

I am using local notification with alarm manager in Xamarin Android, it works fine and when the application was closed notification not displayed.i want to run in background also.

Please help me to resolve this..
Thanks in Advance.


  • JarvanJarvan Member, Xamarin Team Xamurai

    You can try Xam.Plugins.Notifier plugin.

    Display a local notification immediately

    CrossLocalNotifications.Current.Show("title", "body");

    Display a local notification at a scheduled date/time

    CrossLocalNotifications.Current.Show("title", "body", 101, DateTime.Now.AddSeconds(5));

    Cancel a local notification


    Check the link:

  • AnandmauryaAnandmaurya INMember ✭✭
    edited June 2019

    @DeepakDeeps Alarm Manager will not work in Android Oreo 8.0 and higher version. You need to use Job Scheduler to achieve your problem.

    And if you are running in lower version So, Doze is particularly likely to affect activities that AlarmManager alarms and timers manage, because alarms in Android 5.1 (API level 22) or lower do not fire when the system is in Doze.

    To help with scheduling alarms, Android 6.0 (API level 23) introduces two new AlarmManager methods: setAndAllowWhileIdle() and setExactAndAllowWhileIdle(). With these methods, you can set alarms that will fire even if the device is in Doze.

    Note: Neither setAndAllowWhileIdle() nor setExactAndAllowWhileIdle() can fire alarms more than once per 9 minutes, per app.

  • Rajesh_AngappanRajesh_Angappan INMember ✭✭

    @DeepakDeeps Please refer the below sample. Whenever app is killed it will give the notification.

Sign In or Register to comment.