Skip to content

[@capacitor/local-notifications] - Android - Schedule Notification not sending on first occurrence. #2173

@hommalex

Description

@hommalex

Bug Report

Plugin(s)

"@capacitor/app": "^6.0.0",
"@capacitor/local-notifications": "^6.0.0",

Capacitor Version

6

Platform(s)

Android

Current Behaviour

run:

await LocalNotifications.schedule({
          notifications: [
            {
              id: Math.floor((Math.random() * 1000000) + 1),
              title: 'A Title',
              body: 'Some Body',
              schedule: {
                on: {
					weekday: w, // a day of the week
					hour: h, // some hours that week
				},
                every: 'week',
                allowWhileIdle: true,
              },
            }
          ]
        });

Expected Behaviour

Receiving a notification from the first occurrence.
So, If on Monday the 1st, I set a notification to go every Tuesday at 12pm.
I should receive a notification on Tuesday the 2nd.

What happen:

The notification is not sent on the First Tuesday of the occurrence.
It is sent the Tuesday the following week.
But not on the first Tuesday.
This happens to Android device.
So, the workaround is to manually set that missing notification.
But then iOS users will receive 2 notifications on the first Tuesday.

Thank you to fix this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions