Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-14286][TIMOB-14062]iOS: Fixing Calendar bugs. #4435

Merged
merged 2 commits into from
Jul 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions iphone/Classes/CalendarModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,15 @@ -(void) requestAuthorization:(id)args forEntityType:(EKEntityType)entityType
EKEventStore* ourstore = [self store];
[ourstore requestAccessToEntityType:EKEntityTypeEvent
completion:^(BOOL granted, NSError *error){
NSDictionary *propertiesDict = [TiUtils dictionaryWithCode:[error code]
message:[TiUtils messageFromError:error]];
NSDictionary* propertiesDict;
if (error == nil) {
propertiesDict = [TiUtils dictionaryWithCode:(granted ? 0 : 1) message:nil];
} else {
propertiesDict = [TiUtils dictionaryWithCode:[error code]
message:[TiUtils messageFromError:error]];
}
KrollEvent * invocationEvent = [[KrollEvent alloc] initWithCallback:callback eventObject:propertiesDict thisObject:self];
[[callback context] enqueue:invocationEvent];


}];
}, NO);
}
Expand Down
12 changes: 8 additions & 4 deletions iphone/Classes/TiCalendarEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,11 @@ -(void) removeRecurenceRule:(id)arg

-(NSNumber*) save:(id)arg
{
id val = nil;
ENSURE_ARG_OR_NIL_AT_INDEX(val, arg, 0, NSNumber);
EKSpan span = EKSpanThisEvent;
if (arg != nil) {
span = [TiUtils intValue:arg def:EKSpanThisEvent];
if (val != nil) {
span = [TiUtils intValue:val def:EKSpanThisEvent];
}
EKEventStore* ourStore = [module store];
if (ourStore == NULL) {
Expand All @@ -523,9 +525,11 @@ -(NSNumber*) save:(id)arg

-(NSNumber*) remove:(id)arg
{
id val = nil;
ENSURE_ARG_OR_NIL_AT_INDEX(val, arg, 0, NSNumber);
EKSpan span = EKSpanThisEvent;
if (arg != nil) {
span = [TiUtils intValue:arg def:EKSpanThisEvent];
if (val != nil) {
span = [TiUtils intValue:val def:EKSpanThisEvent];
}
EKEventStore* ourStore = [module store];
__block NSError * error = nil;
Expand Down