1
votes

My iOS app (iOS11) reads events from an iPhone calendar using EventKit, which works fine. The calendar I'm reading from is from a (free) gmail account. A Google account on iOS does not support pushing data but only fetching. Calendar events are hence only updated when I open the built-in iPhone Calendar app.

In my app, I continuously display the current events of the day. A timer updates the display of events.

My problem is the following: If I change some events in my calendar on calendar.google.com, the changes are not going to appear in my app, only after I first go to the built-in Calendar app to fetch the data and then switch back to my app.

My question: is there a way using EventKit or another mechanism to force-fetch the calendar data online as happens when I open the Calendar app?

PS: I already tried adding the gmail account using Exchange, which should support Push, but it doesn't work for free gmail accounts.

PPS: If I create a new event using EventKit it gets directly pushed to google and is immediately visible on calendar.google.com. That's great but doesn't help me.

1

1 Answers

0
votes

RefereshSources Use this - you can call force referesh on eventstore after adding event .

EventStore.refreshSourcesIfNecessary()