Firebase Android notification payload

Unlike iOS, for Android Firebase's FCM server accepts payload in slightly different form:

      "token":"<device registration id>",

But there's a caveat: when both the android and data objects are present - only the notification is shown, without data being passed to OnMessageReceived FCM callback method. So in order to send both data and notification at the same time on Android you either have to send two messages - one data and one notification. Or to be a bit more creative 🙂

Show Comments