Contents

requestWriteOnlyAccessToEvents(completion:)

Prompts the person using your app to grant or deny write access to event data.

Declaration

func requestWriteOnlyAccessToEvents(completion: @escaping  @Sendable (Bool, (any Error)?) -> Void)
func requestWriteOnlyAccessToEvents() async throws -> Bool

Parameters

  • completion:

    The block to call when the request completes.

Mentioned in

Discussion

Requesting access to an event store asynchronously prompts people for permission to use their data. The operating system only prompts them the first time your app requests write-only event access; any subsequent instantiations of EKEventStore uses existing permissions. When they grant or deny access, EventKit calls the completion handler on an arbitrary queue.

Your app isn’t blocked while the person decides to grant or deny permission. Because they may deny permission, your app needs to handle the case where it doesn’t receive access to the event store.

If the person grants permission, your app receives write-only access to the event store. Your app can create events, but it can’t access any of the existing calendars and events on the device, including events your app created. API calls to read event data from the event store don’t return any events.

See Also

Requesting access to events and reminders