Contents

authorizationStatus(for:)

Returns an authorization status that indicates whether the user grants the app permission to capture media of a particular type.

Declaration

class func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus

Parameters

  • mediaType:

    A media type for which to check the authorization status. The supported media types are Video and Audio.

Mentioned in

Return Value

An authorization status value.

Discussion

A user must explicitly grant your app access to record audio or video. Call this method to determine your app’s current authorization status. If it returns a value of AVAuthorizationStatus.notDetermined, call requestAccess(for:completionHandler:) to prompt the user for capture permission.

After the user grants permission, the system remembers their choice and doesn’t prompt them again. However, a user can change their choice at any time in the Settings app.

See Also

Authorizing device access