Ios Add Event to Google Calendar

I have a search on how to add a custom Google calendar. In my project, I have an event database (title, startDate, endDate, etc.). When the user clicks the sync button, all of these events must be added to the Google calendar.

I downloaded api from here . But this is for MAC OS. Since I have never worked on a MAC OS application, I cannot figure out how to use it in an iOS application.

Please help me and tell me which view controller to use to request a username and password, then log in to the Google calendar service and add an event to it.

Thanks.

I got http://code.google.com/p/google-api-objectivec-client/ . But it is hard to understand. It takes the username and password from the settings. Then it receives calendars and adds events, but to add we need a ticket and a few more things. This code did some things.

In my method of adding events, I wrote my own event object and tried to add it, but it does not work. Here is the code:

- (void)insertCalendarEvent:(GDataEntryCalendarEvent *)event toCalendar:(GDataEntryCalendar *)calendar { NSLog(@"adding event"); GDataDateTime *time = [GDataDateTime dateTimeWithDate:[NSDate date] timeZone:(NSTimeZone*)[NSTimeZone timeZoneForSecondsFromGMT:0]]; GDataEntryCalendarEvent *newEntry = [GDataEntryCalendarEvent calendarEvent]; [newEntry setTitleWithString:@"title"]; [newEntry addLocation:[GDataWhere whereWithString:@"pune"]]; [newEntry addTime:[GDataWhen whenWithStartTime:time endTime:time]]; [googleCalendarService fetchEntryByInsertingEntry:newEntry forFeedURL:[[calendar alternateLink] URL] delegate:self didFinishSelector:@selector( insertTicket:finishedWithEntry:error: )]; } 

My requirements are simple. I just want to add my custom events to the Google calendar. Get a calendar, get a ticket, and add all my events in a loop.

+3
source share
3 answers

Instead of using the Google API and a new window where the user needs to log in again, you should use EventKit , this is pretty and you can synchronize with the calendar where the user wants, not just Google cal.

+4
source

As @Tuss Laszlo noted, the Google API Client Library is your best option for adding events only to Google Calendar. Google has a sample calendar in its sample code. See an example for the full implementation of adding calendar events.

+1
source

I have the same requirement as yours for integrating your Google calendar and synchronizing events. I researched and found the documentation from here , but I did not understand this clearly, so later I found another good tutorial for accessing the Google Calendar API. You can try this for your requirement.

0
source

Source: https://habr.com/ru/post/1266864/


All Articles