user3575232
user3575232

Reputation: 55

Adding collapse_key in FCM

Is the collapse_key needed for Android and iOS push notifications? If I specify collapse_key in payload, will FCM use it? Or it will add another collapse_key?

Upvotes: 3

Views: 8068

Answers (1)

Ryan
Ryan

Reputation: 2008

Is the collapse_key needed for Android and iOS push notifications?

No, it is not needed, unless you do want to use it, then of course you would use it. This depends on whether you want the messages to be collapsible (meaning that the notification may be 'overwritten' in a sense, by another similar message with the same collapse_key value.

If I specify collapse_key in payload, will fcm use it?

Yes, assuming you don't go over the four-key limit. You choose whatever string value you want to be used as the key and FCM will use it. If, however, you have more than four keys, you will get un-expected behavior. You won't know which keys will work properly in that case.

Or will it add another collapse_key

No Sir.

Upvotes: 4

Related Questions