Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to send data message using firebase console

I'm using firebase console and can send only Notification messages using it.

Is there a way to send data messages using the same?

like image 698
amodkanthe Avatar asked Nov 21 '16 17:11

amodkanthe


People also ask

Can I send SMS from Firebase?

After you have developed logic in your app to receive messages, you can allow non-technical users to send messages per the instructions in the Notifications page in the Firebase Help Center.


1 Answers

The Firebase Notifications Console can only be used to send notification messages. It cannot be used to send data messages.

See the table in message types in the Firebase documentation:

Notification message

Use scenario: FCM automatically displays the message to end-user devices on behalf of the client app. Notification messages have a predefined set of user-visible keys.

How to send:

  1. Use your app server and FCM server API: Set the notification key. May have optional data payload. Always collapsible.

  2. Use the Notifications console: Enter the Message Text, Title, etc., and send. Add optional data payload by providing Custom data in the Notifications console. Always collapsible.

Data message

Use scenario: Client app is responsible for processing data messages. Data messages have only custom key-value pairs.

How to send:

  • Use your app server and FCM server API: Set the data key only. Can be either collapsible or non-collapsible.
like image 119
Frank van Puffelen Avatar answered Oct 05 '22 19:10

Frank van Puffelen