Google关于推送通知的回复 [英] Response from Google Regarding Push Notification

查看:319
本文介绍了Google关于推送通知的回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建Google日历集成的应用程序.当有人手动更改Google日历事件时,我正在尝试从Google接收通知.因此,已经在Google和我的应用程序之间创建了一个渠道.现在的问题是,当Google将响应标头发送到我的重定向URI时,我们没有任何说明它们在哪里更改了日历.请检查我们将收到的回复

I am creating an Application for Google calendar integration. I am trying to get the notification from Google when any one manually change the Google calendar event. So have created a channel between Google and with my application. Now the problem is that when google is sending the response header to my Redirect URI then we don't have any description that where their is a change to calendar. Please check the reply that we will get

POST https://mydomain.com/notifications // Your receiving URL.
Content-Type: application/json; utf-8
Content-Length: 0
X-Goog-Channel-ID: 4ba78bf0-6a47-11e2-bcfd-0800200c9a66
X-Goog-Channel-Token: 398348u3tu83ut8uu38
X-Goog-Channel-Expiration: 1367869013915
X-Goog-Resource-ID:  ret08u3rv24htgh289g
X-Goog-Resource-URI: https://www.googleapis.com/calendar/v3/calendars/my_calendar@gmail.com/events
X-Goog-Resource-State:  exists
X-Goog-Message-Number: 10

那么任何人都可以指导我如何获得事件发生变化的描述.

So can any some guide me how can i get the description that where there is a change to event.

推荐答案

您需要进行增量同步(请参见创作者本身,根据我的口味:

You need to do an incremental sync (see previous SO answer). From the creators themselves slightly revised according to my tastes:

应用程序需要做的第一件事就是获得新的推送功能,即订阅感兴趣的日历.日历更改后,Google会通知您的应用,并且该应用会进行API调用以获取更新.

The first thing the app needs to do is get the new push functionality is to subscribe to a calendar of interest. When a calendar changes, Google will notify your app and the app does an API call to get the update.

作为示例,假设您有一个日历my_calendar@my-host.com.您的应用托管在具有my-host.com域的服务器上,推送通知应传递到HTTPS网络挂钩 https://my-host.com/notification

As an example, let’s assume you have a calendar my_calendar@my-host.com. Your app is hosted on a server with my-host.com domain and push notifications should be delivered to an HTTPS web-hook https://my-host.com/notification

每次my_calendar@my-host.com更改时,Google日历服务器都会在 https://my-host.com/notification .收到回调后,应用程序需要执行增量同步.

Every time my_calendar@my-host.com changes, the Google Calendar server will trigger a web-hook callback at https://my-host.com/notification. After receiving the callback the app needs to do an incremental sync.

这篇关于Google关于推送通知的回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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