I am using https://github.com/stelford/Titanium-Calendar
My problem is that it will not ask the user for permission to their calendar. I know the code works because I was using a different module that was crashing, however it forced the phone I use for testing to give it permission. So now my test phone works great, but no one else's does because it won't actually request permission in the first place.
I don't know how to get this calendar module to force a request to the user for access to their calendar. Any help would be fantastic..
First, you need to check the device to see if it's even requesting access to the calendar. To do this, Go to Settings
-> Privacy
--> Calendars
. If you're application has requested calendar access, it will show up there.
(source: iphone-to-ipad.com)
(source: iphonehacks.com)
There were a couple of problems with this calendar module. I fixed them in obj-c. I had to do quite a few things to the calendar module to make it work smooth on iPad. If you look on the Titanium forums for this calendar module and my name (Blake Rogers) you should be able to find a bunch of changes I've made to the module in obj c to fix the problem.
To perform this fix you will actually need to download the Xcode project for the calendar. After that, you will need to add the following code in the Module/AgCalendarModule.m
file. Replace the startup
method with the following in that file.
Once you've replaced the code you will need to recompile it using the build.py
(if I remember correctly... it's been awhile) once you compile it using the build.py
you can add that version of the module back in your current project that you're working on.
-(void)startup
{
// this method is called when the module is first loaded
// you *must* call the superclass
[super startup];
EKEventStore *es = [[EKEventStore alloc] init];
[es requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
/* This code will run when uses has made his/her choice */
}];
NSLog(@"[INFO] %@ loaded",self);
}
To be honest, Titanium was a horrible experience for me. Once my app got bigger than the initial proof of concept and involved syncing with a remote web server... I started getting weird errors from memory leaks that you couldn't reproduce because the memory leak would attack at different times.
I am currently switching (yes rebuilding the entire app from scratch) to Xamarin (Monotouch) which has been great :)