Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic 4 FCM onNotification not being called

$
0
0

@scattered wrote:

Hi everyone,

I’ve been having trouble with this.FCM.onNotification not being triggered when receiving Push Notifications when the app is either closed, paused or in the foreground.

The notifications are received when the app is closed, but tapping on them simply takes me to the landing page of the app (I can’t read the wasTapped property to redirect the user because onNotification isn’t triggered).

I’m subscribing to onNotification in app.component.ts using the following code:

this.platform.ready().then(() => {

  this.fcm.onNotification().subscribe(data => {

    if (data.wasTapped) {

      this.router.navigate([environment.paths.notifications]);
          
      this.badge.clear();
          
    } else {

      this.setNotificationIndicator();

    }

  });

});

I’ve posted a question to SOF that has some more details, and I’ve posted to the ionic-worldwide slack channel, but nobody has been able to help me out.

Is anybody able to shed some light as to why this issue would occur?

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>