我将我的CRM系统与Google日历同步。要做到这一点,我要求我的用户push notifications谷歌日历进入我的系统。我已经成功地创建了一个手表,并将过期时间设置为2030,但是当我收到来自watch事件的响应时,它会显示该手表的过期时间设置为一个月。
问题:
我的守则:
$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/xxxxxx@gmail.com/events?key=xxxxxxxxxxxxxxxxxxxxWHxxxxxxalt=json
[token] =>
[type] =>
[modelData:protected] => Array发布于 2014-11-06 22:18:09
通知通道可以有一个过期时间,其值由您的请求或任何Google内部限制或默认值确定(使用更多的限制值)。目前还没有自动更新通知通道的方法。当通道接近到期时,必须通过调用watch方法创建一个新的通道。以下是有关通知通道的更多文档,请参见链接。
https://stackoverflow.com/questions/26727963
复制相似问题