从推送通知谷歌日历上的资源 id 获取事件信息
- 使用谷歌日历设置频道.
- 创建一个谷歌日历活动.
- 收到包含以下数据的推送通知.
- 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
请从此处阅读 syncToken
和 nextSyncToken
参数: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 推送通知?
相关文章