notifee icon indicating copy to clipboard operation
notifee copied to clipboard

[Android] getInitialNotification does not consume the notification

Open ayman-kouzayha opened this issue 2 years ago • 26 comments
trafficstars

While using getInitialNotification on Android we noticed that the call is not consuming the notification unless the app is swiped away, if the app was started with an initial notification then sent to the background where after some time the OS could clear the UI from memory, upon relaunching the app getInitialNotification will re-provide the same notification again which does not match the description of the function in the docs.

https://notifee.app/react-native/reference/getinitialnotification

ayman-kouzayha avatar Sep 25 '23 16:09 ayman-kouzayha

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 Oct 23 '23 17:10 github-actions[bot]

Not stale

liamjones avatar Oct 24 '23 09:10 liamjones

I'm having the same problem.

I've run into this as well.

My only solution was to check if getInitialNotification was populated. If it was, store it in async, and load the rest of the app. Then later on my app logic I have a useEffect that checks the async storage key to see if it was opened through a notification. That way I could bypass the situation by only calling getInitialNotification the one time and avoid all the false positives.

allisonadam81 avatar Nov 09 '23 19:11 allisonadam81

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 Dec 07 '23 20:12 github-actions[bot]

Not stale

liamjones avatar Dec 08 '23 09:12 liamjones

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 Jan 05 '24 10:01 github-actions[bot]

Not stale

liamjones avatar Jan 05 '24 10:01 liamjones

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 Feb 02 '24 12:02 github-actions[bot]

Not stale

liamjones avatar Feb 02 '24 16:02 liamjones

Agree...this issue is not Stale. I am facing the same issue. The same Initial Notification is populated every time the app is opened, even when opened by the user.

badhrin avatar Feb 17 '24 15:02 badhrin

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 Mar 16 '24 16:03 github-actions[bot]

Not stale

liamjones avatar Mar 18 '24 08:03 liamjones

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 15 '24 09:04 github-actions[bot]

Not stale

liamjones avatar Apr 15 '24 14:04 liamjones

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 May 13 '24 15:05 github-actions[bot]

Not stale

liamjones avatar May 15 '24 09:05 liamjones

+1

anwargul0x avatar Jun 03 '24 10:06 anwargul0x

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 Jul 01 '24 10:07 github-actions[bot]

Not stale

liamjones avatar Jul 05 '24 14:07 liamjones

Android: For anyone using react native firebase

  • background: use the messaging().onNotificationOpenedApp()
  • close app: use the messaging().getInitialNotification()
  • foreground app: use the notifee.onForegroundEvent()

truongnv98 avatar Jul 18 '24 10:07 truongnv98

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 Aug 15 '24 10:08 github-actions[bot]

@mikehardy are you able to reopen this one as I missed the stale notification before I could bump it.

liamjones avatar Aug 30 '24 15:08 liamjones

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 Sep 28 '24 00:09 github-actions[bot]

Not stale

liamjones avatar Oct 01 '24 07:10 liamjones

probably related to #1043

rodperottoni avatar Oct 02 '24 23:10 rodperottoni