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.
source share