Closed darkrai0101 closed 8 years ago
Sorry for the delayed response
The push notification (events.watch
) is very new feature that they just updated the document. I have included the new function to the library but haven't tested it yet.
First, follow this document https://developers.google.com/google-apps/calendar/v3/push
After you register you verify and register your domain, you should be able to register for push notification of any calendar by this code:
var calendar_id = 'CALENDAR_ID'
var watch_request = {
"id" : "01234567-89ab-cdef-0123456789ab",
"type" : "web_hook",
"address": "https://wanasit.github.io/notifications",
}
gcal.events.watch(calendar_id, watch_request, function(err, result) {
console.log(err)
console.log(result)
})
how can I do this?
thanks