Xamarin ios not able to create/save event into the calendar

NaffieMNaffieM USUniversity ✭✭

I followed the example given by Xamarin on how to create an event programmatically like this: `newEvent = EKEvent.FromStore (dataManager.EventStore);

                            newEvent.StartDate =  (NSDate)DateTime.Now.AddMinutes (10);
                            newEvent.EndDate = (NSDate)DateTime.Now.AddMinutes (40);
                            newEvent.Title = "Appt. to do something Awesome!";
                            newEvent.Notes = "Find a boulder, climb it. Find a river, swim it. Find an ocean, dive it.";
                            newEvent.Calendar = dataManager.EventStore.DefaultCalendarForNewEvents;

                            dataManager.EventStore.SaveEvent(newEvent,EKSpan.ThisEvent,out error);


Then I'm printing the location of the newly saved event to the console, but it's always empty. I the event is also not shown on the calendar, when I check.

` Console.WriteLine ("Event Saved, ID: " + newEvent.CalendarItemIdentifier + "Saved at : " + newEvent.Location);

What am I missing?

Sign In or Register to comment.