Firebase iOS push payload

If you're using Firebase and its FCM (Firebase Cloud Messaging) server directly to send out notifications to iOS users, you might wonder what kind of payload you should send to Firebase in order for the information to be delivered.

So wonder no more 🙂

{
   "message":{
      "token":"<device registration id>",
      "apns":{
         "payload":{
            "aps":{
               "content-available":1,
               "alert":{
                  "title":"title",
                  "subtitle":"subtitle",
                  "body":"body"
               },
               "badge":7,
               "sound":"default"
            }
         }
      },
      "data":{
         "account":{
            "first-name":"Igor",
            "last-name":"Z"
         }
      }
   }
}

In case you need, here's an example of the payload for Android

Show Comments