---
title: "init(decisionHandler:)"
framework: webkit
role: symbol
role_heading: Initializer
path: "webkit/webpage/devicesensorauthorization/init(decisionhandler:)"
---

# init(decisionHandler:)

Creates a new DeviceSensorAuthorization using the specified policy.

## Declaration

```swift
init(decisionHandler: @escaping (WebPage.DeviceSensorAuthorization.Permission, WebPage.FrameInfo, WKSecurityOrigin) async -> WKPermissionDecision)
```

## Parameters

- `decisionHandler`: A closure which decides the permission decision for an authorization request, which may be based on the kind of permission, the webpage frame information, or the security origin.
