thudugala / thudugala/Plugin.LocalNotification
Recurring notification is not working
@thudugala is already working on this.
Since Jun 4, 2024.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.