Dan*_*ous 5 php google-calendar-api google-api push-notification
我找不到任何可以回答这个问题的文档。具体来说,我正在使用日历 API: https: //developers.google.com/google-apps/calendar/v3/push
我知道过期时间应该是自 EPOCH 以来经过的毫秒数。目前,我的有效期是一周后,但我希望它能更长一些——尽可能长。
$chan = new Google_Service_Calendar_Channel();
$chan->setId($channel_id);
$chan->setToken("blahblahblah");
$chan->setType("web_hook");
$chan->setAddress("https://www.mydomain.com/catchPush/");
$chan->setExpiration(strtotime("+1 week")*1000);
$watch = $cal_client->events->watch($calendar_id, $chan);
Run Code Online (Sandbox Code Playgroud)