-
Hello and sorry my bad English I'm french. I have a mobile application with number of notifications for user (same as Facebook, Instagram, ...) : I manage to send messages with notification thanks to your library, thank you :) I manage to update the number of notifications for user in my application when is in the background:
Everything works fine but your documentation says not to update the state from https://rnfirebase.io/messaging/usage#background--quit-state-messages :
Did I do it right ? Thanks you very much :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry for the delay in response - and as someone that speaks English natively but only recently learned Spanish and knows the difficulty of a non-native language, your English is fantastic. Worth saying When we say you should not update state we mean that you should not update any React component state, we mention that because in the background and quit states where setBackgroundMessageHandler runs, there is no active Android Activity, and no components are mounted. I think it is valid to update other types of state (for example redux or ReSub or AsyncStorage etc) and if you integrate with a notification package like react-native-push-notification or Notifee.app it may make sense to post notifications etc, but those are not React components and their related state Hopefully that makes sense? |
Beta Was this translation helpful? Give feedback.
Sorry for the delay in response - and as someone that speaks English natively but only recently learned Spanish and knows the difficulty of a non-native language, your English is fantastic. Worth saying
When we say you should not update state we mean that you should not update any React component state, we mention that because in the background and quit states where setBackgroundMessageHandler runs, there is no active Android Activity, and no components are mounted.
I think it is valid to update other types of state (for example redux or ReSub or AsyncStorage etc) and if you integrate with a notification package like react-native-push-notification or Notifee.app it may make sense to post …