Open mgoldfi1 opened 4 years ago
To anyone encountering a similar issue:
I realized this problem only occurs in debug/release builds but not distribution builds such as testflight which was very difficult for me to find out and eventually discovered by accident. After updating APNS certs to production and pushing the build to testflight, the getInitialNotification method is being hit on app cold start through a push notification. I don't know much else yet but this is what I have found so far.
Report
Environment
Issues and Steps to Reproduce
Expected Behavior
I want a way to be able to tell if the notification was clicked on so that I can either direct the navigation to the chat screen or otherwise just open the app normally. Right now, I can only get _onRemoteNotification to be hit, which is not that useful because I only want to navigate the user if they clicked on the notification, not i they got a notification while they were in the app. I can't find any use cases for this but regardless im not hitting the .catch and its returning null every time. There is a chance I'm using this incorrectly but there is barely any documentation so I guess I should ask when exactly is getInitialNotification supposed to be hit?
Actual Behavior
App opens if you click the notification, sometimes onRemoteNotification is hit sometimes it is not.
Function:
App.js/ componentDidMount : I attach a listener to appState because i want to get the notification whenever it is brought to foreground. Am I doing this correctly/logically?