Open BatDroid opened 5 years ago
where do you call getInitialNotification?
@evollu at index.android.js/index.ios.js before outside the component. but i think this is related to the first bullet point of here. i wish there was a way to fix this or ill have to keep the notifications in a database.
so the problem only happens when you open the app though notification and hit cmd+R to reload JS? sounds a rare use case to me and shouldn't happen in production because you can't reload the app
yes, but unfortunately it happens in my app. my app is the type which user usually opens it when receives push notification and i have implemented codepush in my app. so the scenario (which is not rare) is user opens the app via push notification and then receives a codepush Update and then the js reloads and now there is a problem!
There are a couple ways may works
componentDidMount()
?
react-native : 55.1 react-native-fcm: 16.1.0
whenever i open the app from notification (wether the app had been in background or not Running) and then reloading the app in dev mode the
getInitialNotification
is called and this brings bugs to me in dev mode since based on the notification i navigate user to a screen.(by react-native-router-flux) after opening the notification whenever i press Reload (to refresh the app)getInitialNotification
is called with the same notification object. i've triedremoveAllDeliveredNotification
but it didn't fix the problem. it is in both ios and android