gpt4 book ai didi

php - google calendar watch过期时间超过1个月?

转载 作者:搜寻专家 更新时间:2023-10-31 21:08:46 24 4
gpt4 key购买 nike

我将我的 CRM 系统与 Google 日历同步。为此,我要求我的用户 Google Calendars 将推送通知 推送到我的系统中。我已经成功创建 watch 并将过期时间设置为2030年,但是当我收到 watch 事件的响应时,它显示 watch 的过期时间设置为一个月。

问题:

  1. 这是否意味着我需要每月刷新系统中每个用户日历的 watch ?
  2. 有没有办法让 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

最佳答案

通知 channel 可以有一个到期时间,其值由您的请求或任何 Google Calendar API 内部限制或默认值确定(使用更严格的值)。目前没有自动更新通知 channel 的方法。当 channel 即将到期时,您必须通过调用 watch 方法创建一个新 channel 。这是 link有关通知 channel 的更多文档。

关于php - google calendar watch过期时间超过1个月?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26727963/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com