1
votes

I am developing an app to fetch the device google calendar events in my custom iOS App. I have read the documentation about Event Kit on how to create and edit an edit but i am not able to fetch the google calendar events in my App. Is there any tutorial on how to fetch the google calendar events from the device? I need to fetch the google event ID into my app. Can someone please guide on how to achieve this?

1
bro i need ur help in google calendar swift, i have followed this link developers.google.com/google-apps/calendar/quickstart/… and first page sample is running properly i want to create/save event in google calendarDilip Tiwari

1 Answers

0
votes

This answer may be too delayed one. Hope this will help in future.

To fetch events from native calendar db,

EKEventStore *eventStore = [[EKEventStore alloc] init];

NSPredicate *fetchCalendarEvents = [eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:nil];
//Use any specific calendar if you can provide detail. To get calendar detail, use the below code.

NSArray *eventListforDay = [NSArray arrayWithArray:[eventStore eventsMatchingPredicate:fetchCalendarEvents]];

To select calendar from available system / cloud calendars

NSArray *cals = [NSArray arrayWithArray:[eventStore calendarsForEntityType:EKEntityTypeEvent]];

for(EKCalendar *iCal in cals) {
    if (iCal.source.sourceType == EKSourceTypeCalDAV && [iCal.source.title isEqualToString:YOUR_CALENDAR_TITLE]) {
        //save calendar identifier for future use.
        break;
    }
}