requestAuthorization(completionHandler:)
requestAuthorization(completionHandler:)
requestAuthorization(completionHandler:) Instance Method of INFocusStatusCenter Asks the system for access to the user’s focus status.
func requestAuthorization(completionHandler: (@Sendable (INFocusStatusAuthorizationStatus) -> Void)? = nil)Parameters
completionHandler
The handler block to execute when the authorization status for your app is determined. This block has no return value and takes the following parameter: - term status: The authorization status of your app. For a list of possible values, see `doc://com.apple.sirikit/documentation/Intents/INFocusStatusAuthorizationStatus`.
Discussion
Call this method from your app to request authorization to access the user’s focus status. The first time you make this request, the system prompts the user to grant or deny permission.