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
fix(push-notification): notification not dispatching click when received in foreground #1478
Conversation
…ved in foreground
intent.putExtras(remoteMessage.toIntent().getExtras()); | ||
PendingIntent pendingIntent = PendingIntent.getActivity( | ||
getContext(), | ||
0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of 0, consider adding a unique id
NotificationCompat.Builder builder = new NotificationCompat.Builder( | ||
getContext(), | ||
NotificationChannelManager.FOREGROUND_NOTIFICATION_CHANNEL_ID | ||
) | ||
.setSmallIcon(pushIcon) | ||
.setContentTitle(title) | ||
.setAutoCancel(true) | ||
.setContentIntent(pendingIntent) | ||
.setContentText(body) | ||
.setPriority(NotificationCompat.PRIORITY_DEFAULT); | ||
notificationManager.notify(0, builder.build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 0 here will potentially overwrite the last notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is a separate issue, right? This 0 (and the newly added one) result in the problem/feature that only one push notification can be shown. But the change in this MR still only adds value to capacitor and doesn't break any existing features, so maybe it would be good to merge this anyway, and deal with the other thing separately?
@ftheomunhoz I would very much like this change, as for me, the notification tap event is also missing 👍 |
wow I literally didn't see this PR when I submitted this ionic-team/capacitor#6439 |
I am also facing the same issue, is this PR going to merge or not |
Tried this today and it works 👍 |
Waiting for PR merge...👏 |
Facing some issue with no intent on foreground notifications. Confirm that this patch adds that missing functionality. Any idea when this can be worked on and merged? |
any new update on this? |
Any news? |
any update on this, waiting for this from last 6 months |
Push notifications are missing the intent to allow them to be clickable. Without that, the event
pushNotificationActionPerformed
will never trigger.