谷歌日历手表超过一个月的过期时间?
问题描述:
我使用Google日历同步我的CRM系统。为此,我要求我的用户Google日历中的push notifications
加入我的系统。 我已成功创建手表,并将到期时间设置为2030年,但是当我收到手表事件的响应时,它会显示手表的到期时间设置为一个月。谷歌日历手表超过一个月的过期时间?
问题:
- 这是否意味着我每个月需要刷新每个用户的日历的手表在我的系统?
- 有没有办法让手表无限制?
我的代码:
$channel = new Google_Service_Calendar_Channel($client);
$uuid = gen_uuid();
$channel->setId($uuid);
$channel->setType('web_hook');
$channel->setExpiration('1919995862000');
$address = $sugar_config['site_url'] . "/index.php?entryPoint=updateFromCal";
$channel->setAddress($address);
$watchEvent = $service->events->watch($bean->google_cal_id_c, $channel);
响应:
[address] =>
[expiration] => 1417667348000
[id] => 87453668-b1fd-4468-beca-xxxxxxxxxxxx
[kind] => api#channel
[params] =>
[payload] =>
[resourceId] => xxxxxxxxx-xxxxxxxxxxx
[resourceUri] => https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?key=xxxxxxxxxxxxxxxxxxxxWHxxxxxxalt=json
[token] =>
[type] =>
[modelData:protected] => Array
答
通知信道可以具有期满时间,其中或者通过您的请求或通过任何谷歌日历API内部确定的值限制或默认值(使用更严格的值)。目前没有自动更新通知渠道的方法。当频道接近其到期时,您必须通过调用watch方法创建一个新频道。有关通知渠道的更多文档,请参阅link。