0

I'm using GTLServiceCalendar for fetching the event from a specific calendar.

I mention code below

- (void)fetchEventsFromCalendarId:(NSString *)calendarId {

    GTLQueryCalendar *query = [GTLQueryCalendar queryForEventsListWithCalendarId:calendarId];
    query.maxResults = 10;
    query.timeMin = [GTLDateTime dateTimeWithDate:[NSDate date]
                                         timeZone:[NSTimeZone localTimeZone]];;
    query.singleEvents = YES;
    query.orderBy = kGTLCalendarOrderByStartTime;

    [self.serviceCalendar executeQuery:query
                      delegate:self
             didFinishSelector:@selector(displayResultWithTicket:finishedWithObject:error:)];
}

I need to refresh the list asap when new events are added into Google Calendar with calendarId, without including a server side.


My question: is there any delegate method that will be called when new events are added to my calendarId ?

Constantin Saulenco
  • 2,353
  • 1
  • 22
  • 44
  • There is no available delegate method for this. I think having an open socket just waiting and listening for new events isn't good for battery life. AFAIK, [Push Notifications](https://developers.google.com/google-apps/calendar/v3/push#receiving-notifications) was intended for this scenario. – AL. Apr 21 '17 at 01:46
  • Yes the solution with push using the `GTLCalendarChannel` and `web_hook` channel type I found too, but I wonder if there is a local solution – Constantin Saulenco Apr 21 '17 at 06:22

0 Answers0