invertase / react-native-notifee

Moved to https://github.com/invertase/notifee
https://invertase.io/blog/open-sourcing-notifee
Other
466 stars 31 forks source link

getDisplayedNotifications returning wrong ids #381

Closed alloystory closed 2 years ago

alloystory commented 3 years ago

to reproduce:

await notifee.displayNotification({
    id: 'abc',
    title: 'title',
    body: 'body',
})

console.log(await notifee.getDisplayedNotifications())

expected:

[{
  id: 'abc',
  date: '1630835976663',
  notification: {
      id: 'abc',
      title: 'title',
      body: 'body',
  },
}]

actual:

[{
  id: '3556498',
  date: '1630835976663',
  notification: {
      id: '3556498',
      title: 'title',
      body: 'body',
  },
}]

this happened on Android 11; i didnt test this scenario on other platforms.

adar2378 commented 3 years ago

Same issue. I can not cancel those notifications using the returned ids :|

mikehardy commented 3 years ago

Oh no, that doesn't seem to match expectations. We've got :eyes: on it, thank you for reporting @alloystory and confirming @adar2378 - need to investigate if this is usage issue or a bug as a first pass, and if an error, correct of course

andidev commented 3 years ago

@adar2378 however cancelling works with using the original id notifee.cancelNotification('abc')

andidev commented 3 years ago

Same problem occurs if string is a number string 123

adar2378 commented 3 years ago

@andidev yes, but for unassigned ids it is impossible to detect and cancel the notification by using getDisplayedNotification API

helenaford commented 2 years ago

Hi all, this is now fixed in release v3.0.0 (release notes here)