How to redirect user to a specific screen upon tapping on the notification?

#1

I need to redirect the user to a specific screen when tapping on the notification received by a node server (Firebase cloud function). I am surprised not find a clear guide in the documentation about how to handle this. However, I found some discussions mentioning integrating deep link but there wasn’t any instructions about how to do it. So any help ?

#2

What worked for me was add an event handler for incoming notifications. Here the instructions: https://docs.expo.io/versions/latest/guides/push-notifications.html#3-handle-receiving-andor-selecting-the-notification

Then in your function which handles the notification, you can see if it was tapped by the user. The ‘origin’ will be ‘selected’. We use React Navigation, so depending on the data of the notification, we navigate to different pages within the handler.

Hope that helps.

1 Like
#3

Does this apply on tapping on the notifications in the notifications tray ?

#4

I would assume so but I haven’t tested it.

1 Like
closed #5

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.