dq1685513999 2016-09-24 06:21
浏览 46

Google Calendar PHP API - 无法设置日历通知

I am facing an issue to set a Google Calendar notification. I found some of the questions which was posted on Stack Overflow about How to set Google Calendar Reminder.

I managed to create a new calendar event but the notification still display as No notifications set. Please refer to the screenshot below.

enter image description here

I thought it is because of the permission setting issue at first but it does not help after I change the permission setting to Make changes to event to the specific Google service account. Please refer to the screenshot.

enter image description here

I am using Laravel 5.3 to code the Google Calendar API function. I believe I am using Google Calendar API v3.

Code shown as below.

Composer.json

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.3.*",
    "laravelcollective/html": "5.3.*",
    "google/apiclient": "^2.0",
    "laravel/socialite": "^2.0",
    "mpociot/laravel-firebase-sync": "^1.0"
},

Google Calendar

$event = new \Google_Service_Calendar_Event();
$event->setSummary($server_name . ' Expiry Date');
$event->setDescription('Server Renewal');

$start = new \Google_Service_Calendar_EventDateTime();
$start->setDate($expiry_date);
$event->setStart($start);

$end = new \Google_Service_Calendar_EventDateTime();
$end->setDate($expiry_date);
$event->setEnd($end);

$reminderEmail = new \Google_Service_Calendar_EventReminder();
$reminderEmail->setMethod('email');
$reminderEmail->setMinutes('10');

$reminder = new \Google_Service_Calendar_EventReminders();
$reminder->setUseDefault('false');
$reminder->setOverrides($reminderEmail);
$event->setReminders($reminder);
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序