Ionic 4 + Capacitor + PushNotifications Capacitor plugin


I’m using Ionic 4 + Capacitor to build a small POC app. I’m trying to implement the PushNotification plugin of Capacitor (not the Cordova/PhoneGap way).

I created the application in Firebase and got the google-services.json file which I placed in the Android/app folder.

I call PushNotifications.register() and successfully get a token back which I store in a “users” table in firebase for reference.
I then call:
PushNotifications.addListener(‘pushNotificationReceived’, (notification: PushNotification) => {
console.log('notification ’ + JSON.stringify(notification));
and I get a “result: Object” in the console upon execution of the statement having the correct token in the object properties.

I then create a new pushnotification through firebase console, and it shows me that the number of eligible users to receive the notification is “1” which shows that the client registered correctly.

However when I “publish” the test notification, nothing is received in the client and nothing is actually SENT from the firebase console when you click on the push entry to see the statistics.

I tried with both an android emulator and an android physical device. Same behaviour.

Any ideas on what is going wrong ?

Many thanks !


Update: In Firebase console, I see that the messages I had “pushed” some time ago, are marked as “SENT” but nothing was received in the app. It seems that it takes a while until the message is sent by the console, but the problem with RECEIVING it still persists…

Any hints?