2

I have an universal iOS app, giving efforts to make it compatible with iOS 6. I am using Cordova / Phonegap framework so my app is HTML, CSS and JS. I am using calenderPlugin for Cordova which is available on GitHub, working fine before iOS 6.

Issue starts here: Apple added that, from iOS 6 onwards, before doing any operations on calendars and reminders, we need to grant a permission from user. for that here is the sample code:

EKEventStore    *eventStore = [[EKEventStore alloc] init];

if( [self checkIsDeviceVersionHigherThanRequiredVersion:@"6.0"] ) {

[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {

if (granted){
//---- codes here when user allow your app to access theirs' calendar.

}else
{
//----- codes here when user NOT allow your app to access the calendar.

}

:
:
}];

}


//**********************************************************************************

//   Below is a block for checking is current ios version higher than required version.

//**********************************************************************************

- (BOOL)checkIsDeviceVersionHigherThanRequiredVersion:(NSString *)requiredVersion
{
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];

if ([currSysVer compare:requiredVersion options:NSNumericSearch] != NSOrderedAscending)
{
return YES;
}

return NO;
}

Of course I have added EventKit.Framework and EventKitUI.Framework. Now the thing is, for development of iOS 6 I downloaded and installed xCode 4.5 which comes with iOS6 SDK.

xCode does not find out this method requestAccessToEntityType, neither the constant EKEntityTypeEvent is available.

It seems I am missing EventKit.Framework for iOS 6, but how? I have xCode 4.5 which came with SDK for iOS 6. Any suggestions?

Rodia
  • 1,407
  • 8
  • 22
  • 29
Hardik Thakkar
  • 394
  • 5
  • 17

2 Answers2

2

Issue Solved,

I have added EventKit.framework by right click on frameworks under project and add files to project. these frameworks was for iOS 5. To add framework for iOS 6, first I removed this frameworks from my frameworks folder and then went to Targets > Summary > Linked Frameworks and Libraries. there I pressed + and added EventKit.framework appearing under iOS 6 folder. Cheers :-) happy coding.

Hardik Thakkar
  • 394
  • 5
  • 17
0

Check with your BaseSDK, because I have no problem using it in XCode4.5 with iOS6 SDK. I upgrade my XCode 4.5 via App Store, not from development site though.

Taryn
  • 242,637
  • 56
  • 362
  • 405
snowmen10
  • 29
  • 2
  • 5
  • My Base SDK is already set to Latest iOS (6.0). Have you used EventKit.framework ? Because I think as EKEventStore class in my framework does not contain the method -requestAccessToEntityType so, there should be separate new EventKit.framework for iOS 6. Where to get it? I browsed my system and only iPhoneOS5.0.sdk folder is available from which I added this framework . – Hardik Thakkar Sep 25 '12 at 06:23