It would be great that when the user opens the notification from the tray or just receives it while the app is open, that on the payload receiving side, we can know from which context was the notification received. e.g. receivedFrom: “lock_screen”, receivedFrom: “system_tray”, receivedFrom: “open_app”
Then we can deal with the notification appropriately; e.g. navigate to specific content when from tray or lock screen and when received while app is open, just update badge number of notifications section.
Oh wait, no worries, I forgot about the app life cycle events
while the bundled version of libs doesn’t have support for what you’re asking, with or without lifecycle events, there is a legit workaround.
That workaround is to implement your push notifications by using Firebase and APNS together. If you take a look at the code in one of the repos, you’ll find a param along the lines of fromNotificationBar, like here. That’s what you’re looking for.
Thanks man, I realised I just needed to know if it was coming from “outside the app” or from within for iOS and android, so I just used the life cycle event to track the state of the app before the notification is received.