wizpanda / cordova-plugin-firebase-lib

This repository is moving & merging to https://github.com/wizpanda/cordova-plugin-firebase-lib to avoid confusion to developers.
https://www.wizpanda.com/
MIT License
68 stars 38 forks source link

Android notification while app is in foreground not calling callback function #15

Open steosoft opened 5 years ago

steosoft commented 5 years ago

On Android when application is in foreground, incoming push notification is not calling callback function which is set by:

window.FirebasePlugin.onNotificationOpen(function (notification) {
        console.log(notification);
      }, function (error) {
        console.log("onNotificationOpen error " + error);
      });

and also not showing notification. On iOS notification shows and also callback if fired.

In Android native application method onMessageReceived(RemoteMessage remoteMessage) is called when app is in foreground and we can access to incoming notification by calling remoteMessage.getNotification()

Cordova lib should also run callback as in native application when in foreground.

Swamp3 commented 5 years ago

I am having this problem aswell, onNotificationOpen is not called when the app is in foreground.

tusharvikky commented 4 years ago

Any update here? or any ionicnative plugin which we can use, which supports onMessage instead of just onNotificationOpen?