-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Android] [Notification] [launchMode="singleTask"] On tap of local notification, 'onNotificationOpened' is not getting triggered. #1230
Comments
In my case, "onNotificationOpened" is being called when notification is clicked from system tray, however the notification still sits in the tray; it is not being cleared / removed from the tray. |
@saloni-springct if I am not wrong, you might be using android:launchMode="singleTop". |
@rajatyadav hey, maybe it will be useful for you #1272 (comment) |
Hey, @rajatyadav I got this working. |
@vomchik my code is same as you suggested,
Not working for me. |
Hey @rajatyadav Do you have this in your AndroidManifest?
|
Hey @saloni-springct, yes I have same code in AndroidManifest. |
Can you guys confirm which one is the issue - in the foreground or the background? Are you aware that For the foreground you need to be using |
@Salakar
I'm using react native navigation v2, react-native 0.56. |
Just an update: Neither of these two message objects sent from the server works on click:
|
Is there any update on the solution to this problem ? Android : Please post the solution if anyone knows 🙏 Edit : I would like to add some things that I set up too :
|
#1272 (comment) |
Hey @nikhilboranaarit , the above solution did work for me, but I don't have a splash screen, so I put it in MainApplication file. |
@nikhilboranaarit did you find a way for getting notification when app in background or when app closed? |
Let me add some user feedback about this subject. Only on Android I also noted that plain, locally displayed notifications, when tapped, were not triggering My setup was also using react-native-splash-screen, which even has an open issue on this subject. I tried the proposed workarounds, but that meant restarting the app once a notification is tapped and using In the end I removed the react-native-splash-screen setup, so now I have one single I'm not proficient enough on Android apps to propose a setup that would still have two |
Hi @abhigupta92 , @Salakar : But when app is in foreground : onNotification , doesnt get called . I am using "react-native": "0.57.5", "react-native-firebase": "^5.1.1", async componentDidMount() {
const notificationOpen = await firebase.notifications().getInitialNotification();
Please advise how it works for you on iOS . I am using iOS 11.2 |
Duplicate of wix/react-native-notifications#958 too, I think. |
Issue
I have setup notification for iOS and Android. All notifications and 'tap' behaviour is working fine except one.
In case of Android, when app is in foreground and I am getting any notification, then I am using
firebase.notifications().displayNotification()
To push local notification.According to document, when I will tap on this notification it suppose to trigger,
firebase.notifications().onNotificationOpened()
which is not happening.Notification Code
build.gradle
Dependencies
I also have another change I made which is
in documentation it is
Environment
1. Application Target Platform: Android - targetSdkVersion 22
2. Development Operating System: macOS High Sierra
3. React Native version: 0.55.4
4. RNFirebase Version: 4.2.0
5. Firebase Module: 15.0.2
The text was updated successfully, but these errors were encountered: