I have an Ionic Angular (v.6) app and I want to send push notifications to it. I am using Capacitor Push Notifications (v.1.0.9) library. My capacitor version is 3.
When my app is open, I can get notifications from pushNotificationReceived listener. But when my app is killed/background I can’t get any notifications to system tray. I’ve both tried sending push notifications from my API and FireBase console. What am I missing?
await PushNotifications.addListener("registration", (token) => {
this.h.Toast(this.toastController, token.value);
});
await PushNotifications.addListener("registrationError", (error) => {
this.h.Toast(this.toastController, error.error);
});
await PushNotifications.addListener("pushNotificationReceived", (notification) => {
this.h.Toast(this.toastController, JSON.stringify(notification));
});
await PushNotifications.addListener("pushNotificationActionPerformed", (notification) => {
this.h.Toast(this.toastController, JSON.stringify(notification));
});
PushNotifications.register().then(() => {
PushNotifications.createChannel({id: "test", name: "test", importance: 5});
});