Search code examples
iosgoogle-calendar-apigdata

Check if GDataServiceGoogleCalendar has updates before refreshing?


I am using GDataServiceGoogleCalendar to fetch events for iOS app.

Is there a way to check if the calendar has updates before refetching the events. I am trying to reduce the data transfer and I don't want the app to fetch all the data if there are no changes on google calendar.

Thanks

shani


Solution

  • from the CalendarService, perform a getFeed() for the particular feed you want to sync with. the Feed inherits from com.google.gdata.data.Source, which has a getUpdated and setUpdated methods. you'll have to track your own timestamp in your app; you should be able to compare the two times; if the time of the last sync of your calendar is the same as this value as set from your app, then there are no new entries to pull.