I have searching how to add event t users google calendar. In my project I have database with events(title,startDate,endDate etc). When user clicks sync button all this events should be add to users google calendar.
I downloaded api from here. But its for MAC OS. Since I never worked on MAC OS application I cant understand how to use it in IOS app.
Please help me and tell which view controller to use asking for username and password, then login to google calendar service and add event in it.
Thank you.
I got http://code.google.com/p/google-api-objectivec-client/. But its difficult to understand. It takes username and password from preferences. Then gets calendars and adds events, but to add we need ticket and some more things. This code did some things.
In their add event method I wrote my own event object and tried to add that, but its not working. 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 requirement is simple. I just want add my custom events to google calendar. Get calendar, get ticket, and in for loop add all my events.