问题
How do I stop watching the entire channel? The API reference reproduced below requires a resourceId
, seemingly implying that it only stops watching the event specific to the resourceId
. For my purposes, I would think that a channelId
is enough and therefore uncertain what to put for resourceId
. The field is not optional.
POST https://www.googleapis.com/calendar/v3/channels/stop
Authorization: Bearer {auth_token_for_current_user}
Content-Type: application/json
{
"id": "4ba78bf0-6a47-11e2-bcfd-0800200c9a66",
"resourceId": "ret08u3rv24htgh289g"
}
回答1:
It turns out that the resourceId
has nothing to do with the event that caused the push notification. In your app, you should store both the channelId
and resourceId
and provide it as required to stop notifications. Still not sure why Google requires two ids for a single purpose. Seems redundant.
来源:https://stackoverflow.com/questions/29404356/how-to-stop-watch-on-entire-channel-of-google-calendar-events