React-navigation and push notifications: deep-linking vs listeners

SDK Version: 40
Platforms(Android/iOS/web/all): Android/iOS

I’m setting up push notifications in my app that will navigate users to a specific screen when clicked.

What are the pros and cons of handling this through deep linking versus notification listeners? I’m only handling notifications, not links the user might click somewhere.

For me, a major con of deep linking is that it seems harder to test in development.
Cons on listeners are that I’m not sure about the best place register listeners.

For listeners, I believe I’ll need to do that in a Screen so I can use the navigation prop. I’m not sure how this will work as I navigate around- whether they will remain active, whether they will work when the app is closed, and whether or not I really need to remove listeners.

Thoughts, advice, and experience welcome!

Hi!

We have an example in the docs of using listeners combined with react-navigations Linking prop: Notifications - Expo Documentation

What exactly do you mean by handling this through deep linking? You’ll need a notification listener to handle any notification-related actions no matter what

Cons on listeners are that I’m not sure about the best place register listeners.

Register them as early as possible after app start