How to send notification instead of data when using FCM
Closed this issue · 4 comments
Description/Steps to reproduce
Hey!
I'm trying to use the loopback-component-push
with Firebase Cloud Message (FCM) instead of Google Cloud Message (GCM), since GCM is now deprecated.
In FCM there are two kinds of message: Notification
and Data
. They're better explained here, but the main difference is that Notification
s are displayed in the notification tray, while Data
s are not.
I'm trying to send notifications using the example. Everything works fine, except that on my App I'm only receiving Data
messages. In other words, nothing is displayed on the notification tray.
When I send the message from the FCM Console, the notification is displayed, so I guess I might be missing some configuration here in the loopback-component-push
.
Link to reproduction sandbox
The example can be used as a sandbox.
Expected result
The notification should be displayed in the notification tray, like it happens when sending the message from the FCM console:
Additional information
darwin x64 10.6.0
loopback-demo-push@0.0.0 /Users/demarchisd/Projects/_consulta/push-notifications/loopback-example-push/loopback-3.x
├── loopback@3.22.3
├── loopback-boot@2.27.1
├── loopback-component-explorer@2.7.0
├── loopback-component-push@1.7.0
├── loopback-connector-mongodb@1.18.1
I'm experiencing the same situation. Did you solve it?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS
file at the top-level of this repository.