【发布时间】:2021-04-05 23:49:27
【问题描述】:
我正在使用spatie/laravel-google-calendar 包创建有会议的活动,但它只创建没有会议的活动,我合并了this commit
但它没有工作'仍然创建没有会议的事件'。
这是event.php文件的createFromGoogleCalendarEvent方法
public static function createFromGoogleCalendarEvent(Google_Service_Calendar_Event $googleEvent, $calendarId)
{
// this option are to create a conference and add a link to meet in event
$googleCalendar = static::getGoogleCalendar($calendarId);
$service = $googleCalendar->getService();
$conference = new \Google_Service_Calendar_ConferenceData();
$conferenceRequest = new \Google_Service_Calendar_CreateConferenceRequest();
$conferenceRequest->setRequestId('randomString123');
$conference->setCreateRequest($conferenceRequest);
$googleEvent->setConferenceData($conference);
$googleEvent = $service->events->patch($calendarId, $googleEvent->id, $googleEvent, ['conferenceDataVersion' => 1]);
$event = new static;
$event->googleEvent = $googleEvent;
$event->calendarId = $calendarId;
return $event;
}
这是我创建事件的代码
$event = new Spatie\GoogleCalendar\Event;
$event->name = 'A new event';
$event->description = 'Event description';
$event->startDateTime = Carbon\Carbon::now();
$event->endDateTime = Carbon\Carbon::now()->addHour();
$event->save();
这是我的回应
{
anyoneCanAddSelf: null,
attendeesOmitted: null,
colorId: null,
created: "2021-04-06T11:54:35.000Z",
description: "Event description",
endTimeUnspecified: null,
etag: ""3235420151680000"",
eventType: "default",
guestsCanInviteOthers: null,
guestsCanModify: null,
guestsCanSeeOtherGuests: null,
hangoutLink: null,
htmlLink: "https://www.google.com/calendar/event?eid=dXZyNHByamc0ZXNqbDkxajI5c3I0cWI3c28gZGxvcW45M2VoOWlsZm5lOWRjb2xodDY5aWtAZw",
iCalUID: "uvr4prjg4esjl91j29sr4qb7so@google.com",
id: "uvr4prjg4esjl91j29sr4qb7so",
kind: "calendar#event",
location: null,
locked: null,
privateCopy: null,
recurrence: null,
recurringEventId: null,
sequence: 0,
status: "confirmed",
summary: "A new event",
transparency: null,
updated: "2021-04-06T11:54:35.840Z",
visibility: null,
creator: {
displayName: null,
email: "mohamed-service-account@mohamed-project.iam.gserviceaccount.com",
id: null,
self: null
},
organizer: {
displayName: "Mohamed calendar",
email: "dloqn93eh9ilfne9dcolht69ik@group.calendar.google.com",
id: null,
self: true
},
start: {
date: null,
dateTime: "2021-04-06T13:54:35+02:00",
timeZone: null
},
end: {
date: null,
dateTime: "2021-04-06T14:54:35+02:00",
timeZone: null
},
reminders: {
useDefault: true
}
}
【问题讨论】:
-
欢迎加入堆栈,请阅读How to Ask 编辑您的问题并包含minimal reproducible example 您缺少授权码。另外请告诉我们您所说的“不工作”是什么意思您是否有错误消息响应是什么。
-
@DaImTo 我修改了我的问题的解释并添加了回复。
-
有什么问题?
-
@DaImTo 我尝试使用 google calendar api 在 google meet 上创建会议,但它只创建事件而不创建会议,并且我的响应的 (hangoutLink) 值为 null,这是我的问题。
标签: laravel google-calendar-api google-contacts-api google-meet