Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hommalex opened this issue Aug 14, 2024 · 2 comments

Comments

@hommalex
Copy link

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.

@Ionitron
Copy link
Collaborator

This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks!
Ionitron 💙

@hommalex
Copy link
Author

Hi Ionitron,

It's too easy to reproduce to spend time making a new sample app.

Just create an empty project
add the @capacitor/local-notifications
add the code from the bug report to the onload function

Nothing else to do here.
You can even test it from an existing app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants