[英]Flutter App + Google Calendar API : events.insert not returning 'conferenceData'
我以這個 github 代碼為例,使用服務帳戶在工作區日歷中創建谷歌日歷事件。
我遵循了有關如何使用服務帳戶進行身份驗證和連接的各種示例,現在我能夠創建一個事件,並且它也成功顯示在工作區日歷中。
但是,返回的事件沒有“conferenceData”,我可以從中獲取“conferenceId”來創建 google meet 鏈接。
下面是我使用的插入代碼,它有效但不返回所述會議數據。
await calendar.events.insert(event, calendarId,
conferenceDataVersion: 1, sendUpdates: "none")
.then((value) {
print("Event Status: ${value.status}");
if (value.status == "confirmed") {
print(value.toJson().toString());
String joiningLink;
String eventId;
eventId = value.id;
joiningLink = "https://meet.google.com/${value.conferenceData?.conferenceId}";
print('Event added to Google Calendar : $joiningLink');
}
}
});
這是我打印到控制台的 output:
I/flutter ( 2934): Event Status: confirmed
I/flutter ( 2934): {created: 2022-07-26T16:12:20.000Z, creator: Instance of 'EventCreator', description: xxxx-desc, end: Instance of 'EventDateTime', etag: "3317703881666000", eventType: default, htmlLink: https://www.google.com/calendar/event?eid=djc1b2gyY3RzZ2p1YWGo4aWtmdWIydG5pZ3R2aGNvNEBn, iCalUID: v75oh2ctsgjuahtircv@google.com, id: v75oh2ctv7itndnc, kind: calendar#event, location: Google Meet, organizer: Instance of 'EventOrganizer', reminders: Instance of 'EventReminders', sequence: 0, start: Instance of 'EventDateTime', status: confirmed, summary: xxxxxxx, updated: 2022-07-26T16:12:20.833Z}
I/flutter ( 2934): Event added to Google Calendar : https://meet.google.com/null
關於如何獲取會議數據和會議 ID 的任何建議?
*** 編輯 ****
在我四處挖掘時出現了其他東西:
雖然這對我的用例無關緊要,但谷歌 api 不允許我添加與會者 - 即使它是服務帳戶 email id。
創建事件DetailedApiRequestError時出錯(狀態:403,消息:服務帳戶無法邀請沒有全域授權的與會者。)
我不明白,已經為此帳戶完成了域范圍的委派,這就是為什么我能夠首先進行身份驗證並創建日歷事件。
我的理解錯了嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.