【问题标题】:Google Calendar event watch api and the 'time to live' maximum durationGoogle Calendar event watch api和“生存时间”最长持续时间
【发布时间】:2020-11-24 12:36:47
【问题描述】:

请问是否有人可以确认使用日历事件手表 api 设置推送通知时的最长生存时间看起来只有一个月?

调用这个端点: https://www.googleapis.com/calendar/v3/calendars/blah@gmail.com/events/watch

使用此有效负载:

{
  "id": "blah-014",
  "token": "11223344",
  "type": "web_hook",
  "address": "https://blah.com/NotificationsFromGoogle_v1",
  "params": {
    "ttl": "157680000"
  }
}

无论 ttl 值有多大(大于一个月),我总是会收到回复

"expiration": nnnnnnnnn, // 实际过期时间为 Unix 时间戳(以毫秒为单位),如果适用的话。

设置为最多提前一个月。

【问题讨论】:

    标签: events push-notification google-calendar-api watch


    【解决方案1】:

    通知渠道的有效期为 30 天。因此,在那之后,您可以根据需要更新您的通知频道(目前无法自动更新此频道,如 here 所述)。但是,如果由于某种原因您想停止通知渠道,您应该查看considerations

    参考

    Renewing notification channels

    Stopping notifications

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-13
      • 1970-01-01
      相关资源
      最近更新 更多