Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28467

What is the best approach to passing data from a notification to the application that it opens, using "react-native-firebase v6"?

$
0
0

I want to implement opening a specific screen when interacting with a Push Notification sent from Firebase. My understanding is that I needed to use was getInitialNotification() function that was available in react-native-firebase v5 and lower, but is not available yet in react-native-firebase v6, since the Notifications package is not yet ready. Among other things, so far I have tried setting the background message handler that is available in the Cloud Messaging package, but it doesn't seem to work for something that is not a data-only message:

Firebase.messaging().setBackgroundMessageHandler(async (remoteMessage) => { await storeJSONData('notification', JSON.stringify(remoteMessage)); });

Should I downgrade to react-native-firebase v5 in order to use their getInitialNotification() from the Notifications package, or do I have other better alternatives, like even using android native code?


Viewing all articles
Browse latest Browse all 28467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>