requestSiriAuthorization(_:)
requestSiriAuthorization(_:)
requestSiriAuthorization(_:) Type Method of INPreferences Requests authorization to use Siri services.
class func requestSiriAuthorization(_ handler: @escaping (INSiriAuthorizationStatus) -> Void)Parameters
- handler: 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:
- status
The authorization status of your app. For a list of possible values, see INSiriAuthorizationStatus.
Discussion
Call this method from your app to request authorization to integrate with Siri services. The first time you make this request, Siri prompts the user to grant or deny permission for your app to integrate with Siri. Subsequent calls to the method do not prompt the user again.
The block you provide in the handler parameter is executed asynchronously with the results of your authorization request.