-
Notifications
You must be signed in to change notification settings - Fork 401
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
Adding attendees to a meeting invitation #293
Open
YazeedFares
wants to merge
3
commits into
EddyVerbruggen:master
Choose a base branch
from
YazeedFares:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,7 +377,6 @@ - (NSMutableArray*) eventsToDataArray: (NSArray*)matchingEvents { | |
event.calendar.title, @"calendar", | ||
[df stringFromDate:event.startDate], @"startDate", | ||
[df stringFromDate:event.endDate], @"endDate", | ||
[df stringFromDate:event.lastModifiedDate], @"lastModifiedDate", | ||
nil]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed by accident? |
||
// optional fields | ||
if (event.location != nil) { | ||
|
@@ -459,6 +458,7 @@ - (void)createEventWithOptions:(CDVInvokedUrlCommand*)command { | |
NSNumber* startTime = [options objectForKey:@"startTime"]; | ||
NSNumber* endTime = [options objectForKey:@"endTime"]; | ||
|
||
|
||
NSDictionary* calOptions = [options objectForKey:@"options"]; | ||
NSNumber* firstReminderMinutes = [calOptions objectForKey:@"firstReminderMinutes"]; | ||
NSNumber* secondReminderMinutes = [calOptions objectForKey:@"secondReminderMinutes"]; | ||
|
@@ -467,6 +467,7 @@ - (void)createEventWithOptions:(CDVInvokedUrlCommand*)command { | |
NSNumber* recurrenceIntervalAmount = [calOptions objectForKey:@"recurrenceInterval"]; | ||
NSString* calendarName = [calOptions objectForKey:@"calendarName"]; | ||
NSString* url = [calOptions objectForKey:@"url"]; | ||
NSDictionary* attendeesList = [calOptions objectForKey:@"attendees"]; | ||
|
||
[self.commandDelegate runInBackground: ^{ | ||
EKEvent *myEvent = [EKEvent eventWithEventStore: self.eventStore]; | ||
|
@@ -484,7 +485,7 @@ - (void)createEventWithOptions:(CDVInvokedUrlCommand*)command { | |
myEvent.location = location; | ||
myEvent.notes = notes; | ||
myEvent.startDate = myStartDate; | ||
|
||
int duration = _endInterval - _startInterval; | ||
int moduloDay = duration % (60*60*24); | ||
if (moduloDay == 0) { | ||
|
@@ -493,6 +494,7 @@ - (void)createEventWithOptions:(CDVInvokedUrlCommand*)command { | |
} else { | ||
myEvent.endDate = [NSDate dateWithTimeIntervalSince1970:_endInterval]; | ||
} | ||
|
||
|
||
EKCalendar* calendar = nil; | ||
CDVPluginResult *pluginResult = nil; | ||
|
@@ -545,8 +547,29 @@ - (void)createEventWithOptions:(CDVInvokedUrlCommand*)command { | |
} | ||
[myEvent addRecurrenceRule:rule]; | ||
} | ||
|
||
if (attendeesList != (id)[NSNull null]) { | ||
NSMutableArray *attendees = [NSMutableArray new]; | ||
for(id attendee in attendeesList){ | ||
//Initialize a EKAttendee object, which is not accessible and inherits from EKParticipant | ||
Class className = NSClassFromString(@"EKAttendee"); | ||
id attendeeObject = [className new]; | ||
//Set the properties of this attendee using setValue:forKey: | ||
[attendeeObject setValue:[[attendeesList objectForKey:attendee] objectForKey:@"firstName"] forKey:@"firstName"]; | ||
[attendeeObject setValue:[[attendeesList objectForKey:attendee] objectForKey:@"lastName"] forKey:@"lastName"]; | ||
[attendeeObject setValue:[[attendeesList objectForKey:attendee] objectForKey:@"emailAddress"] forKey:@"emailAddress"]; | ||
[attendees addObject:attendeeObject]; | ||
} | ||
|
||
//Finally, add the invitees to the event | ||
[myEvent setValue:attendees forKey:@"attendees"]; | ||
} | ||
|
||
|
||
|
||
NSError *error = nil; | ||
|
||
|
||
[self.eventStore saveEvent:myEvent span:EKSpanThisEvent error:&error]; | ||
|
||
if (error) { | ||
|
@@ -660,9 +683,7 @@ - (void) createEventInteractively:(CDVInvokedUrlCommand*)command { | |
controller.event = myEvent; | ||
controller.eventStore = self.eventStore; | ||
controller.editViewDelegate = self; | ||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
[self.viewController presentViewController:controller animated:YES completion:nil]; | ||
}); | ||
[self.viewController presentViewController:controller animated:YES completion:nil]; | ||
}]; | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did "_id" go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, I didn't change this area !!
I will check tomorrow
On May 23, 2016 10:43 PM, "Eddy Verbruggen" [email protected]
wrote: