关于GC提醒通知不起作用

时间:2020-06-04 04:20:37

标签: google-calendar-api google-calendar-reminders

我已使用服务帐户将PHP应用程序与Google日历集成。

通过我的应用程序创建的事件成功进行。

我正尝试通过以下重写方法来重写事件提醒设置。

 $event = new \Google_Service_Calendar_Event(array(
                'summary' => 'My App Appointment Reminders2',              
                'description' => 'My App Reminders',
                'start' => array(
                'dateTime' => $start['dateTime'],
                'timeZone' => $zone,
                ),
                'end' => array(
                'dateTime' => $end['dateTime'],
                'timeZone' => $zone,
                ),
                'attendees' => array(
                array('email' => 'example@gmail.com'),
                )
                ,
                'reminders' => array(
                'useDefault' => false
                 ,
                  'overrides' => array(
                  array('method' => 'email', 'minutes' => 15),
                  array('method' => 'popup', 'minutes' => 15),
                  ),
            ),
            ));

对于Usedefault,我还使用了字符串而不是布尔值。仍然不起作用

请帮助我解决此问题。预先感谢...

1 个答案:

答案 0 :(得分:0)

此问题已在Google的“公共问题跟踪器”上reported,正在接受调查

该问题与在通过Calendar API执行请求时使用服务帐户有关。 同时,作为一种解决方法:

  • 请勿使用没有impersonation的服务帐户
  • 相反,启用domain-wide delegeation并让服务帐户模拟具有对日历的编辑者访问权限的域用户
  • 在PHP中,您可以使用 $client->setSubject('user to impersonate');
  • 有关示例,请参见here
相关问题