Skip to content

feat(android): add configurable notification click behavior #2486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dribble-njr
Copy link

@dribble-njr dribble-njr commented Jul 6, 2025

Notification Click Behavior Feature

This feature adds configurable notification click behavior to react-native-track-player for Android.

Problem

Previously, when users clicked on the notification from react-native-track-player, the app would always launch with a hardcoded URI (trackplayer://notification.click) that allows the app to identify that it was opened from a notification click. This behavior was inflexible and didn't provide options for different use cases.

#2433

And in expo case, expo-router will handle the deep link and navigate to an unmatched route. User must add a notification.click.tsx to redirect certain page. But sometimes user just want to open app when click notification other than navigate to certain page.

Solution

Added a new notificationClickBehavior configuration option under android options that allows developers to:

  1. Disable URI data: Launch app without any URI information
  2. Use custom URI: Replace the default URI with a custom one
  3. Use custom action: Replace the default action with a custom one
  4. Complete customization: Combine custom URI and action

@dribble-njr
Copy link
Author

@jspizziri Can you take a look, thanks. I think this is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant