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

[Android 14] Scheduled notifications are not displayed when app is killed #1100

Open
MrSucik opened this issue Sep 19, 2024 · 3 comments
Open

Comments

@MrSucik
Copy link

MrSucik commented Sep 19, 2024

Hello and thank you for work on this package it helped us a lot to deliver useful products for child healthcare.

Recently we've updated to Android SDK 34 and RN 0.72 and suddenly notifications are only displayed when app is open. When closed, notifications are not displayed.

I've already checked:

  1. App notification permissions are enabled
  2. App battery settings are in non-restrict mode
  3. App alarm permissions are enabled
  4. Notification channel is setup with AndroidImportance.HIGH

The code we use to schedule the notification looks something like this:

await notifee.createTriggerNotification(
  {
    android: {
      channelId: "123",
      importance: 4,
      largeIcon: "ic_launcher",
      pressAction: {
        id: "default",
        launchActivity: "default",
        launchActivityFlags: [Array],
      },
      showTimestamp: true,
      sound: "default",
      visibility: 1,
    },
    body: "xxx",
    title: "xxx",
  },
  {
    alarmManager: true,
    repeatFrequency: 2,
    timestamp: 1726902000000,
    type: 0,
  }
);

Note: Even when alarmManager is undefined or false the result is the same.

When this code triggers notification 10 seconds from now it shows correctly, but if I close the app within these 10 seconds the notification is not shown.

Help would be much appreciated. Thanks 🙏

@infiniteline
Copy link

My code is running with SDK 34 and RN 0.74. One of the only differences I see in my code is that instead of:

alarmManager: true,

I have:

alarmManager: { allowWhileIdle: true, }

@MrSucik
Copy link
Author

MrSucik commented Oct 8, 2024

thanks for the suggestion, unfortunately that does not change the result 😿

@3sluz
Copy link

3sluz commented Oct 17, 2024

Same issue

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

No branches or pull requests

3 participants