Unable to identify which action button is clicked when two buttons are added for Android push notification
Issue
I am unable to identify which action button is clicked when there are multiple action buttons present in the push notification. Also on clicking the button when the app is in the background, NotificationOpen.action is android.intent.action.VIEW instead of the value which I set when creating an action for the button.
Environment
- Application Target Platform: Android
- Development Operating System: macOS Sierra
- Build Tools: Android Studio 3.1.3
React Nativeversion: 0.53.0
React Native FirebaseVersion: 4.3.8
FirebaseModule: Notifications
- Are you using
typescript? no
Loving react-native-firebase? Please consider supporting them with any of the below:
- 👉 Back financially via Open Collective
- 👉 Follow
React Native FirebaseandInvertaseon Twitter - 👉 Star this repo on GitHub ⭐️
@Salakar , Please help me with this issue. It is not letting me to use action buttons for the android push notification.
Duplicate of https://github.com/invertase/react-native-firebase/issues/1330.
If still facing problem to render Action button, make sure you've imported
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
In MainApplication.java
and added
new RNFirebaseNotificationsPackage() line inside getPackages()
it will looks like below:
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNFirebasePackage(),
new RNFirebaseMessagingPackage(),
new RNFirebaseNotificationsPackage()
);
}