从推送通知谷歌日历上的资源 id 获取事件信息 [英] Get event info from resource id on push notification google calendar

查看:22
本文介绍了从推送通知谷歌日历上的资源 id 获取事件信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 使用谷歌日历设置频道.
  2. 创建一个谷歌日历活动.
  3. 收到包含以下数据的推送通知.
  4. X-Goog-Resource-Id,X-Goog-Resource-Uri,X-Goog-Channel-Id

现在我找不到如何获取,修改了哪些事件数据或创建了某些事件.

Now i could not find how to get, which event data modified or some event has been created.

如何通过推送通知标头数据查找事件列表(在第 4 行中提到.)

How can I find event list by push notification headers data (mentioned in line 4.)

推荐答案

标头数据中没有更改的资源/事件列表.谷歌只是让你知道你的日历发生了一些变化.

There is no changed resource/event list in header data. Google just lets you know that something has changed in your calendar.

要在每次 Google Post 请求后获取更改的资源,您需要使用 syncToken 从 google 列出您的日历事件并保存新的事件,该事件将显示为 nextSyncToken回复.如果您在请求中提供 syncToken 参数,您将只能获得从 syncToken 到现在的更改.Google 将此过程称为 增量同步.

To get changed resources after every Google Post request, you need to list events of your calendar from google with syncToken and save the new one which will appear as nextSyncToken in response. If you provide syncToken parameter in your request, you will only get the changes from syncToken to now. Google calls this process incremental sync.

https://developers.google.com/google-apps/日历/v3/sync#incremental_sync

请从此处阅读 syncTokennextSyncToken 参数:https://developers.google.com/google-apps/calendar/v3/reference/events/list

please read syncToken and nextSyncToken parameters from here: https://developers.google.com/google-apps/calendar/v3/reference/events/list

其他链接:如何处理 Google Calendar API 推送通知?

这篇关于从推送通知谷歌日历上的资源 id 获取事件信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆