invertase / react-native-notifee

Moved to https://github.com/invertase/notifee
https://invertase.io/blog/open-sourcing-notifee
Other
465 stars 31 forks source link

🤷‍♂️ How to open the browser with a link when tapping on a notification? #300

Closed fabyeah closed 3 years ago

fabyeah commented 3 years ago

I want to open an external link instead of opening the app. It seems to me this is possible via android custom activities described in the docs: https://notifee.app/react-native/docs/android/interaction#advanced-android-custom-activity

I can open a browser window from there, right? But in the example, no data is passed to the activity. How do I access notification data from the activity, to get the url?

Also, how would I achieve the same in iOS? Not possible?

fabyeah commented 3 years ago

It should be possible to do this with React Native Linking in onBackgroundEvent, checking for EventType.ACTION_PRESS.