pushok icon indicating copy to clipboard operation
pushok copied to clipboard

apns-expiration may be zero

Open chimit opened this issue 5 years ago • 2 comments

According to the APNS documentation apns-expiration header may be a Unix timestamp down to 0. But the setExpirationAt() method requires a DateTime value only and converts it to the Unix timestamp before sending it to the APNS. The way you can make it work looks too cumbersome at the moment:

$notification->setExpirationAt(date_create('1970-01-01 00:00:00', timezone_open('UTC')));

Any ideas on how to improve the developer experience here?

chimit avatar May 05 '20 04:05 chimit

Any response?

webocoders avatar Oct 13 '23 17:10 webocoders

Setting it to date 1970-01-01 00:00:00 does the job, which make the getTimestampe() function to return 0

image

zaidiqbal avatar Mar 12 '24 18:03 zaidiqbal