One of our customer has reported that pushes are delivered with big delay. Pushes are send to APNS in less than 5 seconds as per our statistics but it takes sometimes up to 5 minutes for notifications to arrive on devices.
The authentication used is certificate based even though token based authentications is also tried out before. They have around 346252 subscribed device tokens (users) to which important pushes are send out.
We use HTTP/2 based connections and reuses the connections. To avoid push bursts over selective connection, we distribute push traffic across different APNs servers.
Sample headers:
[:method: POST, :authority: api.push.apple.com, :path: /3/device/<device>, :scheme: https, apns-expiration: 1723721057, apns-priority: 10, apns-topic: <apns topic>, authorization: bearer <bearer token>]
Sample payload: {"reference":"{"id":"lux.DvKH5JCtCcus5EaW5Houcn","type":"articleReference"}","aps":{"badge":0,"alert":{"body":"„Warum werden nicht ein paar gesetzliche Feiertage gestrichen?“ Munich-Re-Chef Joachim Wenning fordert, dass die Deutschen mehr arbeiten sollten"},"sound":"default","mutable-content":1},"tracking":"{"piano":{"ivw_category":"thema_wirtschaft","pcat":"paid","date_sent":1723629099370,"main_topic":"unternehmen","push_channel":"11124","section":"wirtschaft","object_id":"lux.DvKH5JCtCcus5EaW5Houcn","push_text":"warum_werden_nicht_ein_paar_gesetzliche_feiertage_gestrichen_munich_re_chef_joachim_wenning_fordert_dass_die_deutschen_mehr_arbeiten_sollten_plus"},"ivw":{"ivw_category":"thema_wirtschaft","ivw_code":"spracheDE/formatTXT/erzeugerRED/homepageNO/auslieferungMOB/appYES/paidNO/inhaltTHEMA/merkmalWIRTSCHAFT/ressortWIRTSCHAFT/portalAPP"},"firebase":{"ivw_category":"thema_wirtschaft","pcat":"paid","date_sent":1723629099370,"main_topic":"unternehmen","push_channel":"11124","section":"wirtschaft","object_id":"lux.DvKH5JCtCcus5EaW5Houcn","push_text":"warum_werden_nicht_ein_paar_gesetzliche_feiertage_gestrichen_munich_re_chef_joachim_wenning_fordert_dass_die_deutschen_mehr_arbeiten_sollten"}}"}
Please let us know what could be the reason and steps we could take to avoid such delivery delays.