diff --git a/Source/CalendarManager.swift b/Source/CalendarManager.swift
index 679ac40cf..587cd5912 100644
--- a/Source/CalendarManager.swift
+++ b/Source/CalendarManager.swift
@@ -117,13 +117,23 @@ class CalendarManager: NSObject {
func requestAccess(completion: @escaping (Bool, EKAuthorizationStatus, EKAuthorizationStatus) -> ()) {
let previousStatus = EKEventStore.authorizationStatus(for: .event)
- eventStore.requestAccess(to: .event) { [weak self] access, _ in
+ let requestHandler: (Bool, Error?) -> Void = { [weak self] access, _ in
self?.eventStore.reset()
let currentStatus = EKEventStore.authorizationStatus(for: .event)
DispatchQueue.main.async {
completion(access, previousStatus, currentStatus)
}
}
+
+ if #available(iOS 17.0, *) {
+ eventStore.requestFullAccessToEvents { access, error in
+ requestHandler(access, error)
+ }
+ } else {
+ eventStore.requestAccess(to: .event) { access, error in
+ requestHandler(access, error)
+ }
+ }
}
func addEventsToCalendar(for dateBlocks: [Date : [CourseDateBlock]], completion: @escaping (Bool) -> ()) {
diff --git a/Source/edX-Info.plist b/Source/edX-Info.plist
index f75ef8d60..b2f4fbc1a 100644
--- a/Source/edX-Info.plist
+++ b/Source/edX-Info.plist
@@ -84,6 +84,8 @@
NSCalendarsUsageDescription
edX would like to use your calendar list to subscribe to your personalized edX calendar for this course.
+ NSCalendarsFullAccessUsageDescription
+ edX would like to use your calendar list to subscribe to your personalized edX calendar for this course.
NSCameraUsageDescription
so you can take a picture for a profile image
NSContactsUsageDescription