Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum allowed expiration time for a Google notification channel?

I can't find any documentation that answers this question. Specifically, I'm using the calendar API: https://developers.google.com/google-apps/calendar/v3/push

I know that the expiration time is supposed to be the number of elapsed milliseconds since EPOCH. Currently, I have it expire in a week, but I want it to be longer - as long as possible.

$chan = new Google_Service_Calendar_Channel();
$chan->setId($channel_id);
$chan->setToken("blahblahblah");
$chan->setType("web_hook");
$chan->setAddress("https://www.mydomain.com/catchPush/");
$chan->setExpiration(strtotime("+1 week")*1000);
$watch = $cal_client->events->watch($calendar_id, $chan);
like image 776
Dane Iracleous Avatar asked Jun 10 '14 10:06

Dane Iracleous


People also ask

How do I use Google push notifications?

Turn on notifications for Android devicesTap More on the bottom navigation bar and select Settings. Tap Turn on notifications. Tap Notifications. Tap Show notifications.

Can Google Calendar send push notifications?

To help remind you about upcoming events, you can get notifications on your phone, computer, or by email. You can change your notification settings for one event or multiple events.

Does Google Calendar have an API?

Millions of people use Google Calendar to track their events. The Calendar API lets you integrate your app with Google Calendar, creating new ways for you to engage your users.


1 Answers

The maximum TTL appears to be one month.

Try setting the expiration to one year, and monitor the expiration Google returns in the result.

like image 157
shuadoc Avatar answered Oct 17 '22 01:10

shuadoc