notifee icon indicating copy to clipboard operation
notifee copied to clipboard

iOS handle consecutive push notifications with long sound

Open sanduluca opened this issue 10 months ago • 1 comments

Hi all. I have a question regarding ios notifications with sound. So i have a type of notification that has a sound of 25 seconds. The problem if the server sends 2 or 3 consecutive notification with a delay lets say 5 seconds, the notification sounds overlay.

The only solution for now is to cancel the previous notification, but we dont want to remove it from notification center:

const displayedNotifications = await notifee.getDisplayedNotifications();
const prevNotification = displayedNotifications[1];
if(prevNotification?.notification.data?.type === "LONG") {
  notifee.cancelNotification(prevNotification.id);
}

Does anyone know why the iOS doesn't discard the previous notification sound when new notification arrive ? On Android its working fine (following notification discard the sound of current notification if its still playing)

Maybe you know some resources to read about this. I couldn't find a better solution for this

sanduluca avatar Apr 01 '24 13:04 sanduluca

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Apr 29 '24 13:04 github-actions[bot]