Skip to content

Commit

Permalink
Fix iOS 17 Calendar permission request
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhnx committed Oct 27, 2023
1 parent ba3909e commit bbf9846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Shift/Shift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ public final class Shift: ObservableObject {
}

private func requestCalendarAccess() async throws -> Bool {
try await eventStore.requestAccess(to: .event)
if #available(iOS 17, *) {
try await eventStore.requestFullAccessToEvents()
} else {
try await eventStore.requestAccess(to: .event)
}
}
}

Expand Down

0 comments on commit bbf9846

Please sign in to comment.