push-plugin icon indicating copy to clipboard operation
push-plugin copied to clipboard

Not getting notifications when in foreground

Open madsongr opened this issue 8 years ago • 3 comments

I made some tests and working with push-plugin or firebase plugin the notification is received (I can get the log in console) but not displayed in android shade.

Sending with google's firebase console or curl x post:

  • notification is displayed in shade only in background mode;
  • when in foreground mode I can only see the result in console.log;

Sending with php script:

  • notification is NOT displayed in shade even in background or foreground mode (I can only see the result in console.log);

Is this a bug? It really should display the notifications in any case. Is there any change to be made in code? Some others platforms we can specify the behavior of the incoming notification.

madsongr avatar Jan 15 '18 16:01 madsongr

Hi @madsongr, as far as I know, when the app is in foreground, Firebase is just calling the onMessageReceived callback.

If you need to display the notifications in the notifications bar in any case, you could try using the local notifications plugin in your notificationsCallback as a workaround.

DimitarTachev avatar Jan 19 '18 16:01 DimitarTachev

@DimitarTachev ok, but this is an issue from this plugin, right? Native development and cordova display a new notification even with the app in foreground. We have options to manage the behavior of the incoming notification.

madsongr avatar Jan 19 '18 20:01 madsongr

@madsongr, its something that could be part of the plugin. I marked it with help wanted and feature request in order to be considered for some of the future versions of the plugin.

DimitarTachev avatar Jan 22 '18 10:01 DimitarTachev