evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 682 forks source link

When notification is received it is being registered on both listeners, that is registerKilledListener and registerAppListener, when app is on the foreground. #968

Open willikay11 opened 6 years ago

willikay11 commented 6 years ago

Hi,

When notification is received it is being registered on both listeners, that is registerKilledListener and registerAppListener, when app is on the foreground. When the app is killed, its is only being registered on the killedListener which is fine.

  1. I am using react-native-fcm version 51.
  2. Using genymotion emulator API 23.
  3. When is running in the foreground.

Thanks.

evollu commented 6 years ago

this is expected behavior. Can you break your notification handling logic into 2 pieces and put part in registerKilledListener and part in registerAppListener? like data storage goes into registerKilledListener and UI change to registerAppListener