EventKit

RSS for tag

Create, view, and edit calendar and reminder events using EventKit and EventKitUI. Request read-only, write-only, or full-access to Calendar data.

Posts under EventKit tag

147 Posts

Post

Replies

Boosts

Views

Activity

EventKit on Vision Pro
How do I access the user's reminders on Vision Pro? When I use the same code from iOS with EventKit, the reminders and reminder lists are empty. Is the way to access reminders the same on VisionOS as it is on iOS, iPadOS, and macOS? Or is there a new framework? Thanks.
0
0
737
Sep ’23
Cannot modify title of Event in Calendar
Hi, I'm creating a calendar application. I am using the EKeventEditViewController to add events to my application. The problem is that the title of the sheet cannot be modified. When I change a title, the console shows that the title has changed. However, the simulator still displays the previous title; "New Event". How can I fix it? void (^showEventEditingController)(EKEvent *) = ^(EKEvent * event){ EKEventEditViewController *controller = [[EKEventEditViewController alloc] init]; controller.event = event; controller.eventStore = [self getEventStoreInstance]; controller.editViewDelegate = self; NSLog(@"%@", controller.title); // "New Event" controller.title = @"My Custom title"; NSLog(@"%@", controller.title); // "My Custom title" [self assignNavbarColorsTo:controller.navigationBar]; [self presentViewController:controller]; NSLog(@"%@", controller.title); // "My Custom title" };
1
0
717
Aug ’23
add EKAttendee on EKEvent, but happen crash issue on iOS16.4
on iOS16.4, if try to add EKAttendee on EKEvent, it will cause app crash; this can not reproduce on iOS14.5/iOS15.7 etc low version. Add Main example Attendee code: Class className = NSClassFromString(@"EKAttendee"); NSMutableArray *attendeessystem = [NSMutableArray new]; for(int i=0; I<1;i++){ id attendee = [className new]; [attendee setValue:@"test" forKey:@"firstName"]; [attendee setValue:@"hihi" forKey:@"lastName"]; [attendee setValue:@"test@outlook.com" forKey:@"emailAddress"]; [attendeessystem addObject:attendee]; } if([attendeessystem count]>0) { [calendarEvent setValue:attendeessystem forKey:@"attendees"]; } crash log: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil' *** First throw call stack:
2
0
883
Aug ’23
Deleting an event deletes the event on the iPhone calendar, but not on the MacBook one.
Hello! I receive events in this way: let store = EKEventStore() let predicate = store.predicateForEvents(withStart: startDate, end: endDate, calendars: nil) let events = store.events(matching: predicate) And remove one of them in this way: try store.remove(event, span: .thisEvent, commit: true) It removes event from iPhone's calendar, but does not from MacBook's. The event came from Google calendar. If I do these things with an event came from iCloud calendar, it works both on iPhone and MacBook. I have tried different ways to solve this problem but without success. I would appreciate any help.
2
0
913
Jul ’23
iCloud Calender APi integration
Hi there, I am in the process of developing a web app using PHP, and I prefer not to use any packages or libraries. The main functionality of this app will be allowing users to create, edit, and delete calendar events. However, I am currently facing difficulties in determining the best approach to achieve this. I have been unable to find any clear resources or tutorials on how to proceed with implementing the calendar API. My question is, do I need to enroll in the Apple Developer Program to accomplish this? How can i pass authentication and make CRUD operation? I am seeking assistance from someone who can provide detailed guidance on where to start and how to proceed with implementing the calendar functionality. Thank you
0
0
1k
Jul ’23
How to perform an action based on the local time?
Hi! I would like to make text appear based on the local time of the user. The idea is that when it's between 00:00:01 AM and 11:00:00 AM, that the text will say "breakfast" and that when it's between 11:00:00 AM and 03:00:00 PM, the text will say "lunch". Etc. I found this code online but I can't get it working. Can you help me? Possibly with other code? . Contentview: struct Test: View { var now = Date() var breakfastTime = Date.parse("00:00:01") var lunchTime = Date.parse("11:00:00") var dinerTime = Date.parse("16:00:00") func activeDinerCourse() -> String { if now > breakfastTime && now < lunchTime { return "Breakfast" } if now > lunchTime && now < dinerTime { return "Lunch" } if now > dinerTime && now < Date.parse("23:59:59"){ return "Diner" } return "Something went wrong..." } var date = Date.now.formatted(date: .omitted, time: .shortened) var body: some View { VStack { Text("\(date)") Text(activeDinerCourse()) } } } . .Parse extention public extension Date { static func parse(_ string: String, format: String = "HH:mm:ss") -> Date { let dateFormatter = DateFormatter() dateFormatter.timeZone = NSTimeZone.default dateFormatter.dateFormat = format let date = dateFormatter.date(from: string)! return date } func dateString(_ format: String = "HH:mm:ss") -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = format return dateFormatter.string(from: self) } } . Thank you!
2
0
1.7k
Jun ’23
Full calendar access needed to display event details that my app created?
Hello, I watched the EventKit session from WWDC 23 (https://developer.apple.com/videos/play/wwdc2023/10052/) that details the new permission changes. The ability to have just write access to the calendar is great, however my app also offers the user to view the already created event and to possibly edit it further via EKEventEditViewController. The event in question is release date of a videogame, so there might be needs for edit and based on saved event identifier, I am able to show different icon to let the user know that event exists. When the user taps on the icon, I use the eventStore.event(withIdentifier:. So I guess I will need the new "full access" with new prompt API to keep my functionality? Is there any possibility that this will change and apps would be able to query event they created? Thanks
1
0
2.0k
Jun ’23
What does the console output mean when using EventKitUI on Xcode 15.0 beta
I create a simple app to enable user add an agenda to their calendar. I create an EventEditViewController which can be used in my SwiftUI app. When I tap the save button appeared on the sheet, the agenda can be saved to calendar but comes with some Xcode console output: redactedMimicSaveEvent: could not find corresponding remoteUI user committed permanent objectID for hostTempID[x-apple-eventkit:///Alarm/t6]. initialTempID[x-apple-eventkit:///Alarm/t5] What does that mean?
0
0
633
Jun ’23
Handling permissions in a Swift Library
I am developing a dynamic library in Swift for MacOS that will be used by another app as a plugin. The app is not written in Swift and I cannot access its source nor modify it. The problem is that my library should provide access to the Calendar using EKEventStore, but then I can't seem able to requestAccess to the library since the application which will be using my library as a plugin doesn't have the necessary NSCalendarsUsageDescription entry in its Info.plist (it's not even written in Swift) and it seems I cannot just specify such an entry in the Info.plist of my library. What is the recommended way to give calendar access permission to a library? Or otherwise, is there a way for a library to modify the access requirements of an app?
1
0
874
Jun ’23
EventKit on Vision Pro
How do I access the user's reminders on Vision Pro? When I use the same code from iOS with EventKit, the reminders and reminder lists are empty. Is the way to access reminders the same on VisionOS as it is on iOS, iPadOS, and macOS? Or is there a new framework? Thanks.
Replies
0
Boosts
0
Views
737
Activity
Sep ’23
Cannot modify title of Event in Calendar
Hi, I'm creating a calendar application. I am using the EKeventEditViewController to add events to my application. The problem is that the title of the sheet cannot be modified. When I change a title, the console shows that the title has changed. However, the simulator still displays the previous title; "New Event". How can I fix it? void (^showEventEditingController)(EKEvent *) = ^(EKEvent * event){ EKEventEditViewController *controller = [[EKEventEditViewController alloc] init]; controller.event = event; controller.eventStore = [self getEventStoreInstance]; controller.editViewDelegate = self; NSLog(@"%@", controller.title); // "New Event" controller.title = @"My Custom title"; NSLog(@"%@", controller.title); // "My Custom title" [self assignNavbarColorsTo:controller.navigationBar]; [self presentViewController:controller]; NSLog(@"%@", controller.title); // "My Custom title" };
Replies
1
Boosts
0
Views
717
Activity
Aug ’23
FirebaseFirestore
when i use FirebaseFirestore in flutter app i got below error so plz guide to me. [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (FirebaseFirestore)
Replies
1
Boosts
0
Views
1.1k
Activity
Aug ’23
Event create with iCloud Calendar in Nodejs
How to create an event and sync with iCloud Calendar in Nodejs?
Replies
0
Boosts
0
Views
688
Activity
Aug ’23
Why am I encountering an ISO error while trying to build my iOS app in Xcode
"Why am I encountering an ISO error while trying to build my iOS app in Xcode? What could be the potential causes and how can I troubleshoot and resolve this issue?"
Replies
0
Boosts
0
Views
602
Activity
Aug ’23
iOS 17 EKEventViewController can't open url directly
when use EKEventViewController to open event details,can't open url directly for iOS17.
Replies
0
Boosts
0
Views
653
Activity
Aug ’23
add EKAttendee on EKEvent, but happen crash issue on iOS16.4
on iOS16.4, if try to add EKAttendee on EKEvent, it will cause app crash; this can not reproduce on iOS14.5/iOS15.7 etc low version. Add Main example Attendee code: Class className = NSClassFromString(@"EKAttendee"); NSMutableArray *attendeessystem = [NSMutableArray new]; for(int i=0; I<1;i++){ id attendee = [className new]; [attendee setValue:@"test" forKey:@"firstName"]; [attendee setValue:@"hihi" forKey:@"lastName"]; [attendee setValue:@"test@outlook.com" forKey:@"emailAddress"]; [attendeessystem addObject:attendee]; } if([attendeessystem count]>0) { [calendarEvent setValue:attendeessystem forKey:@"attendees"]; } crash log: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil' *** First throw call stack:
Replies
2
Boosts
0
Views
883
Activity
Aug ’23
Is there an api to get the email associated to an event on the MacOS calendar
I'm trying to find a way to retrieve the email account associated to calendar events on the Mac. Is there a way to do that? I tried looking in to the EKEvent object and it does not indicate the email account. I also tried looking in to the ACAccountStore.
Replies
0
Boosts
0
Views
505
Activity
Jul ’23
Only used EventKit's calendarsForEntityType API, but a user trigger the address book privacy alert
Only used EventKit's calendarsForEntityType API, but a user trigger the address book privacy alert. Is it possible for EventKit to trigger the privacy alert of the address book?
Replies
0
Boosts
0
Views
831
Activity
Jul ’23
Deleting an event deletes the event on the iPhone calendar, but not on the MacBook one.
Hello! I receive events in this way: let store = EKEventStore() let predicate = store.predicateForEvents(withStart: startDate, end: endDate, calendars: nil) let events = store.events(matching: predicate) And remove one of them in this way: try store.remove(event, span: .thisEvent, commit: true) It removes event from iPhone's calendar, but does not from MacBook's. The event came from Google calendar. If I do these things with an event came from iCloud calendar, it works both on iPhone and MacBook. I have tried different ways to solve this problem but without success. I would appreciate any help.
Replies
2
Boosts
0
Views
913
Activity
Jul ’23
iCloud Calender APi integration
Hi there, I am in the process of developing a web app using PHP, and I prefer not to use any packages or libraries. The main functionality of this app will be allowing users to create, edit, and delete calendar events. However, I am currently facing difficulties in determining the best approach to achieve this. I have been unable to find any clear resources or tutorials on how to proceed with implementing the calendar API. My question is, do I need to enroll in the Apple Developer Program to accomplish this? How can i pass authentication and make CRUD operation? I am seeking assistance from someone who can provide detailed guidance on where to start and how to proceed with implementing the calendar functionality. Thank you
Replies
0
Boosts
0
Views
1k
Activity
Jul ’23
TN3152: Migrating to the latest Calendar access levels
Follow these guidelines to update your app to use the new Calendar access levels. View Technote TN3152 >
Replies
1
Boosts
0
Views
1.1k
Activity
Jun ’23
How to perform an action based on the local time?
Hi! I would like to make text appear based on the local time of the user. The idea is that when it's between 00:00:01 AM and 11:00:00 AM, that the text will say "breakfast" and that when it's between 11:00:00 AM and 03:00:00 PM, the text will say "lunch". Etc. I found this code online but I can't get it working. Can you help me? Possibly with other code? . Contentview: struct Test: View { var now = Date() var breakfastTime = Date.parse("00:00:01") var lunchTime = Date.parse("11:00:00") var dinerTime = Date.parse("16:00:00") func activeDinerCourse() -> String { if now > breakfastTime && now < lunchTime { return "Breakfast" } if now > lunchTime && now < dinerTime { return "Lunch" } if now > dinerTime && now < Date.parse("23:59:59"){ return "Diner" } return "Something went wrong..." } var date = Date.now.formatted(date: .omitted, time: .shortened) var body: some View { VStack { Text("\(date)") Text(activeDinerCourse()) } } } . .Parse extention public extension Date { static func parse(_ string: String, format: String = "HH:mm:ss") -> Date { let dateFormatter = DateFormatter() dateFormatter.timeZone = NSTimeZone.default dateFormatter.dateFormat = format let date = dateFormatter.date(from: string)! return date } func dateString(_ format: String = "HH:mm:ss") -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat = format return dateFormatter.string(from: self) } } . Thank you!
Replies
2
Boosts
0
Views
1.7k
Activity
Jun ’23
Full calendar access needed to display event details that my app created?
Hello, I watched the EventKit session from WWDC 23 (https://developer.apple.com/videos/play/wwdc2023/10052/) that details the new permission changes. The ability to have just write access to the calendar is great, however my app also offers the user to view the already created event and to possibly edit it further via EKEventEditViewController. The event in question is release date of a videogame, so there might be needs for edit and based on saved event identifier, I am able to show different icon to let the user know that event exists. When the user taps on the icon, I use the eventStore.event(withIdentifier:. So I guess I will need the new "full access" with new prompt API to keep my functionality? Is there any possibility that this will change and apps would be able to query event they created? Thanks
Replies
1
Boosts
0
Views
2.0k
Activity
Jun ’23
iOS 16.5 Beta on XCode 14.3
Is iOS 16.5 Beta available on XCode 14.3 or higher?
Replies
6
Boosts
5
Views
4.1k
Activity
Jun ’23
What does the console output mean when using EventKitUI on Xcode 15.0 beta
I create a simple app to enable user add an agenda to their calendar. I create an EventEditViewController which can be used in my SwiftUI app. When I tap the save button appeared on the sheet, the agenda can be saved to calendar but comes with some Xcode console output: redactedMimicSaveEvent: could not find corresponding remoteUI user committed permanent objectID for hostTempID[x-apple-eventkit:///Alarm/t6]. initialTempID[x-apple-eventkit:///Alarm/t5] What does that mean?
Replies
0
Boosts
0
Views
633
Activity
Jun ’23
Get events from a calendar url
I have an ical url to a calendar. I want to get the events of that day without a user needing to add the calendar to their iPhone. Can someone help me, because I don’t know where to start. This is iOS.
Replies
1
Boosts
0
Views
1.4k
Activity
Jun ’23
Handling permissions in a Swift Library
I am developing a dynamic library in Swift for MacOS that will be used by another app as a plugin. The app is not written in Swift and I cannot access its source nor modify it. The problem is that my library should provide access to the Calendar using EKEventStore, but then I can't seem able to requestAccess to the library since the application which will be using my library as a plugin doesn't have the necessary NSCalendarsUsageDescription entry in its Info.plist (it's not even written in Swift) and it seems I cannot just specify such an entry in the Info.plist of my library. What is the recommended way to give calendar access permission to a library? Or otherwise, is there a way for a library to modify the access requirements of an app?
Replies
1
Boosts
0
Views
874
Activity
Jun ’23
Getting the URL for an EKSource calDAV object?
I searched and couldn't find anything, which shocks me, I can't be the only person to ask this. Therefore my search skills are once again demonstrated to be weak. Given an EKCalendar, I can get the source thence sourceIdentifier... but that's just a UUID; can I get the actual URL for that? I assume it's somewhere?
Replies
1
Boosts
0
Views
836
Activity
Jun ’23
TN3153: Adopting API changes for EventKit in iOS 17, macOS 14, and watchOS 10
Test your existing apps against EventKit API latest changes. View Technote TN3153 >
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’23