wix / react-native-notifications

React Native Notifications
MIT License
3.25k stars 764 forks source link

always get new rootTag, when I open the app from notification #866

Closed ysshir closed 2 years ago

ysshir commented 2 years ago

Hi, I'm new to react-native, -navigation, -notification.. and I have 2 issues only on Android.

  1. when I open the app from notification, I always get new rootTag, (which means create new instance??) so splash screen is showing each times, and useEffect runs.... I'm not sure if it's right or not. if it's right, I think I need to unsubscribe events and subscribe again. but in iOS, I can get same rootTag.

  2. without registerNotificationReceivedBackground, I can get notification. in registerNotificationReceivedForeground, I need to write Notifications.postLocalNotification to get notification, but in background, the system recognize notification without writing codes...

any help will be great. thanks...

ysshir commented 2 years ago

so I think 2nd one must be https://github.com/wix/react-native-notifications/issues/856

I commented out postNotification(null); and works great.

ysshir commented 2 years ago

should I write special code for New Intent? instead of using notificationOpened? 🤔

https://developer.android.com/training/notify-user/navigation

ysshir commented 2 years ago

1st one can be same as https://github.com/wix/react-native-notifications/issues/850