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.
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.
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);