I am currently building a laravel provider service to send push notifications to IOS devices. I have followed this tutorial for creating a sample app which is able to receive notifications.
On my server side, I used this package to handle push notifications.
During testing, the app manages to receive push notifications when the device is connected to wifi/4G, during foreground/background/inactive modes. However if I send the push notification to the app when its offline, on connecting the device back to the internet I do not receive any notifications.
According to the apple documentation, the APNS service stores any notification which is sent when the device is offline and delivers it to the client after connection is re-established. It is supposed to dispose of any notifications if the device stays offline for a long time (duration not exactly specified). However I am keeping the device offline for only a minute before going online. Can anyone please suggest a solution?
apns-expiration..If this value is nonzero, APNs stores the notification and tries to deliver it at least once, repeating the attempt as needed if it is unable to deliver the notification the first time. If the value is 0, APNs treats the notification as if it expires immediately and does not store the notification or attempt to redeliver it.- Brandon