Vishnu Vasudevan
Vishnu Vasudevan

Reputation: 76

Prefix in fcm message ID

When I send message using fcm (https://fcm.googleapis.com/fcm/send) I am getting the response as shown below.

 {
        "multicast_id": 1918435360665515386,
        "success": 1,
        "failure": 0,
        "canonical_ids": 0,
        "results":
        [
            {
                "message_id": "0:1578308939759111%64af3761f9fd7ecd"
            }
        ]
    }

Why is message_id in the format 0:xxxxx ? What does this zero mean ?

Upvotes: 0

Views: 784

Answers (2)

Dmitriy Mitiai
Dmitriy Mitiai

Reputation: 1200

I faced with the same ids, when tried to send messages to iOS devices. I noticed that this happens when a new push token was generated. The most interesting thing is that when I see similar IDs I don't receive any push notification in iOS device. When you launch the application second time, something happens, not sure where exactly and sending the push gives another message_id - just a simple number (timestamp).

Conclusion:

When the push notification was sent, but was not received, you can get an id with 0:xxx scheme. When push was sent and was received you'll see a single timestamp number.

Upvotes: 1

Kuilin Wang
Kuilin Wang

Reputation: 1

The leading '0' is the type digit. AFAIK, all message IDs start with 0 which means we only have one type currently. Hope this answered your question.

Upvotes: 0

Related Questions