Skip to content

Commit 49ccc2d

Browse files
committed
fix: use non-deprecated EKAuthorizationStatus enums
1 parent 20a1194 commit 49ccc2d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

permissions.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ bool HasOpenSystemPreferencesDialog() {
256256
(type == "calendar") ? EKEntityTypeEvent : EKEntityTypeReminder;
257257

258258
switch ([EKEventStore authorizationStatusForEntityType:entity_type]) {
259-
case EKAuthorizationStatusAuthorized:
259+
case EKAuthorizationStatusWriteOnly:
260+
case EKAuthorizationStatusFullAccess:
260261
return kAuthorized;
261262
case EKAuthorizationStatusDenied:
262263
return kDenied;

test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const { askForCalendarAccess, getAuthStatus } = require('./index.js')
2+
3+
const status = getAuthStatus('calendar')
4+
console.log(`Current access status: ${status}`)
5+
6+
askForCalendarAccess().then((status) => {
7+
console.log(`Access to Contacts is ${status}`)
8+
})

0 commit comments

Comments
 (0)