Skip to content

Recurring notification is not working #504

@erossini

Description

@erossini

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.

Metadata

Metadata

Assignees

Labels

AndroidAndroid only issuebugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions