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.

EventKit Documentation

Posts under EventKit tag

60 Posts
Sort by:
Post not yet marked as solved
1 Replies
800 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
638 Views
I have an idea for an iOS App that involves creating alarms and "undismissable" notifications. Currently, iOS has multiple system features like silent/ring mode, focus mode, security protections, and other system features that would limit the functionality of an app with this purpose. Basically, think of a system Amber Alert or how the iOS Alarm app works. Regardless of these system settings, the user will be notified of the importance of the alarm immediately. What I'm trying to develop are really two separate things. First an alarm app without a snooze (or a set snooze limit) where you must prove that you're awake. Second, integrate a web API service for volunteer first responders that notify them to respond to an emergency via an iOS app. These are not features that would limit a user's privacy, their experience using iOS, and, quite frankly, be something that is so difficult to implement. If anyone can direct me to any system APIs that would be available to use for the start of this app or make me aware of any "blockers" that would absolutely prevent me from developing this in iOS, I would really appreciate it. My research has not been very in depth and there are differences in opinions on approaches and possibilities. If you are an engineer at Apple and this turns out to be impossible or impractical with current versions of iOS, it would be great to have the ability to be able to do something of this nature in the future.
Posted
by
Post not yet marked as solved
1 Replies
649 Views
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?
Posted
by
Post not yet marked as solved
2 Replies
641 Views
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.
Posted
by
Post not yet marked as solved
2 Replies
586 Views
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:
Posted
by
Post not yet marked as solved
1 Replies
600 Views
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?
Posted
by
Post not yet marked as solved
1 Replies
490 Views
Hi, For some reason, I have an AppleID account that data in the Reminders app appears to be corrupt. This AppleID is tied to a MacBook Pro, an iPhone and an iPad Pro - 2 of the 3 share the same data, but the third doesn't. And the 2 that share the same data, the options provided for the reminders seems to be an earlier version. I do remember an OS upgrade or so ago, the Reminders database was upgraded, so this appears to be maybe the upgrade failed. I'd be happy to delete all the Reminders data for this account and start over, but I'm not sure how to do that. Any advice? Thanks, Neil
Posted
by
Post not yet marked as solved
0 Replies
381 Views
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?
Posted
by
Post not yet marked as solved
1 Replies
1.1k Views
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
Posted
by
Post marked as solved
2 Replies
1.4k Views
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!
Posted
by
Post not yet marked as solved
0 Replies
688 Views
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
Posted
by
Post not yet marked as solved
1 Replies
862 Views
We use Eventkit Framework to synchronize the meeting calendar to the system calendar, read the System Calendar with -[EKEventStore calendarsForEntityType:], Use - [EKEventStore saveEvent: span: commit: error:] wrote system calendar. This usage currently triggers the Contacts Permission Alert on a user. Through the log, we identified no use - [CNContactStore requestAccessForEntityType: completionHandler:] and Contacts API.
Posted
by