【发布时间】:2023-04-06 00:25:02
【问题描述】:
为了让我们的用户能够在 Google 日历中查看我们的日历,我们目前在自己的服务帐户上创建了一个日历,然后使用 ACL 与用户共享此日历。
过去,新日历会自动显示在用户帐户的“其他日历”下。他们会收到来自 Google 的电子邮件通知,其中包含“我们已自动将此日历添加到您的 Google 日历帐户。您可以随时隐藏或完全删除此日历。”
但是,日历突然没有显示在他们的帐户中。最终我注意到通知电子邮件现在显示:“将此日历添加到您的其他日历后,您可以随时隐藏或完全删除它。”带有链接“添加此日历.”
只有在点击此链接后,日历才会出现在他们的帐户中。
这是 Google 突然改变政策吗?有没有办法避免这第二步?
这是一些示例代码。我们启用并验证的范围是“.../auth/calendar”、“email”、“profile”、“openid”。
calendar = service.calendars().insert(body={
'description': description,
'summary': summary,
'timeZone': timezone,
}).execute()
service.acl().insert(
calendarId = calendar['id'],
body={
'role': 'reader',
'scope': {
'type': 'user',
'value': user_email,
}
}).execute()
【问题讨论】: