thudugala / thudugala/Plugin.LocalNotification

Recurring notification is not working

Open
#504 10 comments 0 reactions 1 assignee View on GitHub

@thudugala is already working on this.

Since Jun 4, 2024.

Android bug
Dominant language
C#
Stars
474
Forks
73
PR merge metrics
No merged PRs in 30d

Description

In my NET8 MAUI, I'm using the plugin Plugin.LocalNotification. I set a notification to be repeated daily with this code:

INotificationService _notificationService;

var notifyDateTime = 
    DateTime.Parse($"{DateTime.Now.ToShortDateString()} 08:00:00");
var notification = new NotificationRequest
{
    NotificationId = 100,
    Title = AppResources.NotificationsTitle,
    Description = AppResources.NotificationDescription,
    CategoryType = NotificationCategoryType.Status,
    Schedule =
    {
        NotifyTime = notifyDateTime,
        RepeatType = NotificationRepeat.Daily
    }
};

await _notificationService.Show(notification);

The notification is fired once and then nothing. I thought the notification would stay there until the cancellation and fired daily. Do I have to resend the notification again every time it is fired?

I added in the MauiProgram.cs the following lines

var builder = MauiApp.CreateBuilder();
builder
	.UseMauiApp<App>()
	.........
	.UseLocalNotification();

For the other settings, I followed the documentation. In the AndroidManifest.xml I added the following lines

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />

The issue I had was with the Google Play. When I submitted the app with those settings, Google rejected my app because it is not an agenda or a calendar.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.