Php 假日日历推送通知
我已实现此代码段,以便为传递的日历创建监视事件:Php 假日日历推送通知,php,google-calendar-api,google-api-php-client,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 =
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-此资源不支持推送通知(原因是pushNotSupportedForRequestedResource)
用户向我的应用程序授予日历、calendars.readonly、电子邮件和个人资料的授权
有人知道为什么只有在那些日历上才会出现这种行为吗?好吧,请确保您可以在日历中看到这个假期 通过检查日历中启用的其他日历,您可以在自己的日历中验证它
这是显示“我的日历”中已启用假日日历的屏幕截图 是的,我可以看到意大利的
假日
日历。使用日历Id可以正确检索日历