推送假期日历的通知

时间:2016-12-13 17:33:26

标签: php google-calendar-api google-api-php-client

我已实现此代码段以创建传递日历的观看事件:

try
{
  $channel = new \Google_Service_Calendar_Channel;
  $channel->setId($id);
  $channel->setType('web_hook');
  $channel->setAddress($notification_url);
  $channel->setParams(['ttl' => $ttl]);
  $channel = $this->client->events->watch($calendar->getId(), $channel);
}
catch(\Google_Service_Exception $e)
{
  var_dump($e->getErrors());
}

除了假日和联系人日历之外,这适用于所有日历(也是共享日历)。事件监视端点响应为400 - Push notifications are not supported by this resource (reason pushNotSupportedForRequestedResource)

用户向我的应用程序授予日历,日历,电子邮件和个人资料。

任何人都知道为什么这种行为只适用于那些日历?

1 个答案:

答案 0 :(得分:1)

好吧,请确保您可以在日历中看到这个假期。

您可以通过查看日历中启用的其他日历来验证您自己的日历。

以下屏幕截图显示了我的日历中启用了假日日历。 enter image description here

相关问题