Skip to content
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 receives the notification but does not open the APP when tap at the notification #53

Open
mafbasha opened this issue Sep 29, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@mafbasha
Copy link

Only on Android, the device receives the notification but does not open the application when tapping on the notification.
On ios the behavior is as expected

scheduleDate.setSeconds(scheduleDate.getSeconds() + 20);
CapacitorNotifications.schedule([
  {
    id: 100,
    title: "Enterprise Background Runner",
    body: "Received silent push notification",
    scheduleAt: scheduleDate,
  },
]);
resolve();
@theproducer theproducer self-assigned this Oct 4, 2023
@theproducer theproducer added the bug Something isn't working label Oct 4, 2023
@strttn
Copy link

strttn commented Aug 28, 2024

I'm also having this problem.
I'm using version 1.0.6-dev-20240628T145630.0 (as that has fixes for Capacitor 6)
I wondered if there had been any progress?
It seems like a fairly obvious requirement that tapping the notification should open the app so I wondered if this has ever worked or if there's something obvious I'm missing?
Thanks.

@yshalsager
Copy link

yshalsager commented Sep 3, 2024

Apparently the plugin doesn't make use of actionTypeId in android.

I have been able to make clicking the notification opens the app by modifying native plugin android code.

This might not be the most correct way, I am not an Android dev so not sure :)

val channelId = it.channelId ?: defaultNotificationChannelID
val intent = context.packageManager.getLaunchIntentForPackage(context.packageName)
intent?.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
val pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
val builder = NotificationCompat.Builder(context, channelId)
builder.setContentIntent(pendingIntent)

@FloSojer
Copy link

I'm also facing this issue with Version 2.0.0, is there any update?
Also the App-Icon is not Appearing - just an Info Icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants