How to group iOS push notifications for unread messages into a single one

We have a messenger on iOS client.
When you disable internet on the device, receive many messages and enable the internet, the device receives many push notifications. I want to receive only one push notification with the total count of unread messages.
How can I achieve this from the server side? As far as I know, configuration of APNs is done from the server. Or it should be done from the client?
I read about apns-collapse-id, will it help me? Will it display the total amount of unread messages?

How to group iOS push notifications for unread messages into a single one
 
 
Q