Is there any way to add iCal event to the iPhone Calendar from the custom App?
Currenctly there is no API for manipulating calendars from your own application on the phone. There is an API for the address book.
Anyone know if this is going to be addressed?
I guess your app could talk to a server which modified a calendar that got published back to the phone using Mobile ME !!!
Rather you than me.
Yes there still is no API for this (2.1). But it seemed like at WWDC a lot of people were already interested in the functionality (including myself) and the recommendation was to go to the below site and create a feature request for this. If there is enough of an interest, they might end up moving the ICal.framework to the public SDK.
https://developer.apple.com/bugreporter/
If you use Google Calendar to sync you IPhone calendar you can use the Google Data Calendar API to add an event to Google Calendar and this is pushed to you IPhone calendar
The Google idea is a nice one, but has problems.
I can successfully open a Google calendar event screen - but only on the main desktop version, and it doesn't display properly on iPhone Safari. The Google mobile calendar, which does display properly on Safari, doesn't seem to work with the API to add events.
For the moment, I can't see a good way out of this one.
Calendar access is being added in iPhone OS 4.0:
Calendar Access
Apps can now create and edit events directly in the Calendar app with Event Kit.
Create recurring events, set up start and end times and assign them to any calendar on the device.
Hi. You can do this using the Event Kit framework in OS 4.0.
Right click on the FrameWorks group in the Groups and Files Navigator on the left of the window. Select 'Add' then 'Existing FrameWorks' then 'EventKit.Framework'.
Then you should be able to add events with code like this:
//
// EventTestViewController.m
// EventTest
//
// Created by Some Person on 5/07/10.
// Copyright __MyCompanyName__ 2010. All rights reserved.
//
#import "EventTestViewController.h"
#import <EventKit/EventKit.h>
@implementation EventTestViewController
- (void)viewDidLoad {
[super viewDidLoad];
EKEventStore *eventStore = [[EKEventStore alloc] init];
EKEvent *event = [EKEvent eventWithEventStore:eventStore];
event.title = @"EVENT TITLE";
event.startDate = [[NSDate alloc] init];
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
i want to make an app that can synchronize google cal and calendar in iphone..i want to do it through coding...is it possible..?
one method -- i have an app that can fetch events from google cal and show in table view...i can add these events to iphone 's native calendar..can i try these code in iphone simulator...
other method is their any code that can directly store the google cal's events in iphone native cal..?