Quickstart-ios: Support for apns-collapse-id

Created on 5 Aug 2016  路  18Comments  路  Source: firebase/quickstart-ios

In the WWDC 2016 Session 707 the http/2 header apns-collapse-id is introduced as a way to update (or remove) push notifications.

When will FCM support this capability? Will it leverage the collapse_key parameter or be exposed in an alternative manner?

Most helpful comment

Any update on apns-collapse-id feature Integration in FCM? Thanks

All 18 comments

@daveanderson thanks for the feature request, the team is aware of this feature and will look into how it can be used with FCM.

@kroikie any update on this?

Any update about apns-collapse-id? Thanks

Also looking for updates on how and when Firebase is able to support apns-collapse-id. Any pointers? Thanks.

Any update on apns-collapse-id feature Integration in FCM? Thanks

Still waiting for apns-collapse-id 馃憥

I'm looking for this as well

also waiting for that. apns-collapse-id

Hi all, apns-collapse-id as well as all other APNs features are now supported in the new FCM HTTP API. See the docs for more on how you can use platform-specific options like apns-collapse-id

Hi @kroikie I tried to use the apns-collapse-id , but it didn't collapsed my notifications.

I used apns-collapse-id as a header in the http call.

I also tried the apns-collapse-id but it does not work, below is my part of json that I am sending to firebase api
"apns":{ "headers":{ "apns-collapse-id":"message_update" } },

Is there any change required in app or in api call?

Make sure you're using the new v1 API.

If you're POSting your data to https://fcm.googleapis.com/fcm/send you're still using the lagacy API.

Do we have a functioning structure that contains apns-collapse-id that successfully collapses notifications that are being sent using firebase cloud functions ?

This is my json message using the apns-collapse-id. It seems to work:

    values = {
  "message":{
    "topic" : "home_sub",
    "notification" : {
      "body" : "Flash sale on home item: Toaster!",
      "title" : "Sale",
      },
    "apns":{
        "headers":{
            "apns-collapse-id":"1"
        }
    }
   }
}

@Winghin2517 Very helpful! Thanks a lot

@Winghin2517 can you please tell me how to pass from backend ? Currently im using this:
$headers = array(
'Authorization: key=' . $FIREBASE_API_KEY,
'Content-Type: application/json',
'apns-collapse-id':'1'
);

but its not working . How to pass it in header from backend

@Winghin2517 can you please tell me how to pass from backend ? Currently im using this:
$headers = array(
'Authorization: key=' . $FIREBASE_API_KEY,
'Content-Type: application/json',
'apns-collapse-id':'1'
);

but its not working . How to pass it in header from backend

Did you find any solution for this? I am doing the same.

This is my json message using the apns-collapse-id. It seems to work:

    values = {
  "message":{
    "topic" : "home_sub",
    "notification" : {
      "body" : "Flash sale on home item: Toaster!",
      "title" : "Sale",
      },
    "apns":{
        "headers":{
            "apns-collapse-id":"1"
        }
    }
   }
}

it doesn't work

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EthanDoan picture EthanDoan  路  6Comments

bakeddean picture bakeddean  路  6Comments

myflashlab picture myflashlab  路  7Comments

sundarsan picture sundarsan  路  3Comments

abdulKarim002 picture abdulKarim002  路  6Comments