Reputation: 19
Dear Google Calendar Team,
We want to develop Push Notification for calendar. I have gone through the article https://developers.google.com/google-apps/calendar/v3/push.
But I have couple of questions:-
-Rahul
Upvotes: 0
Views: 805
Reputation: 1
Not sure about C but can be easily accessed from C++. You can check this
Use this documentation to genrate the credentails for orgnaziation from this, you will get the projectId which can be used as the channel id
Domain are those which is generated for your organization it could be anything which your organization use like example.com.An app can access domain-owned calendars without requiring user credentials if it authenticates using a service account refer this to read about domain
Use can go through this documentation to get the sample for code
But for your understanding let me provide the sample here also
{
"id": "01234567-89ab-cdef-0123456789ab", // Your channel ID.
"type": "web_hook",
"address": "https://example.com/notifications", // Your receiving URL.
...
"token": "target=myApp-myCalendarChannelDest", // (Optional) Your channel token.
"expiration": 1426325213000 // (Optional) Your requested channel expiration time.
}
Upvotes: 0
Reputation: 117216
Do we have calendar push notification in C also?
The Google Calendar API supports push notifcations you can use the Google Calendar api in any language that supports http post or http get.
How to get notification channel id?
From the documentation documentation
Register the domain of your receiving URL.
For example, if you plan to use https://example.com/notifications as your receiving URL, you need to register https://example.com. Set up your receiving URL, or "Webhook" callback receiver.
This is an HTTPS server that handles the API notification messages that are triggered when a resource changes.
Set up a notification channel for each resource endpoint you want to watch.
A channel specifies routing information for notification messages. As part of the channel setup, you identify the specific URL where you want to receive notifications. Whenever a channel's resource changes, the Google Calendar API sends a notification message as a POST request to that URL.
Directly from the documentation
What does domain means in this context? Domain will be gmail.com always.
Domain will always be your domain you don't have control of gmail.com so cant get satisfaction to that.
Can you share a sample which can show working push notification of calendar?
The documentation page contains information on how to use push notifications. this is not in C. you will need to code your own implementation of this.
Upvotes: 1