在 google 日历中收到有关更改的通知

Get notified about changes in a google calendar

我想知道,是否可以设置一个 Mac OS X 应用程序,以便在用户更改 Google 日历时收到通知。比如你可以用 EKEventStore?

做什么

有一个查询方法 + (id)queryForCalendarListWatchWithObject:(GTLCalendarChannel *) 对象,但我不太确定你应该如何设置 GTLCalendarChannel 对象。

或者除了轮询之外,使用推送通知是唯一的方法吗?

提前致谢。

您可以使用 Google 日历 API,它提供推送通知让您关注资源。这使得定期轮询变得不必要。

You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.

要使用此 API,您需要:

当日历更改时,它会通知您的应用程序,并且该应用程序会执行 API 调用以获取更新。您可以使用 Google API client libraries 之一来利用推送通知。

检查这些 documentation and blog 关于 Google 日历 API 推送通知。

希望对您有所帮助!