1

It's used to work when I push to TOKEN. But when I try to push notification to topic, something does not go well. I use Insomnai (for test) in this case. Please see image bellow. enter image description here

When I push to TOKEN, I get something like this. {"multicast_id":9172729834316753697,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1527660959875252%2fd9afcdf9fd7ecd"}]}

But now I get this {"message_id": 5081465269920720395}. Please advise me why I can't get

lyhong
  • 947
  • 1
  • 13
  • 23

1 Answers1

0

This is expected.

When you send a message to tokens, you'll receive:

{
  multicast_id: number, // Unique ID (number) identifying the multicast message.
  success: number // Number of messages that were processed without an error.
  failure: number // Number of messages that could not be processed.
  results: [
    {
      message_id: String // a unique ID for each successfully processed message.
      error: String // the error that occurred when processing the message for the recipient. 
    }
  ]
}

When you send a message to topics, you'll receive

either

{
  message_id: number // The topic message ID when FCM has successfully
                     // received the request and will attempt to deliver
                     // to all subscribed devices.
}

or

{
  error: string // Error that occurred when processing the message.
}

Read more at Interpreting a downstream message response. https://firebase.google.com/docs/cloud-messaging/http-server-ref#interpret-downstream

user276648
  • 6,018
  • 6
  • 60
  • 86