<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKUIDelegate/webView(_:requestGeolocationPermissionFor:initiatedByFrame:decisionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKUIDelegate(im)webView:requestGeolocationPermissionForOrigin:initiatedByFrame:decisionHandler:"
  },
  "title" : "webView(_:requestGeolocationPermissionFor:initiatedByFrame:decisionHandler:)"
}
-->

# webView(_:requestGeolocationPermissionFor:initiatedByFrame:decisionHandler:)

```
optional func webView(_ webView: WKWebView, requestGeolocationPermissionFor origin: WKSecurityOrigin, initiatedByFrame frame: WKFrameInfo, decisionHandler: @escaping @MainActor @Sendable (WKPermissionDecision) -> Void)
```

```
optional func webView(_ webView: WKWebView, requestGeolocationPermissionFor origin: WKSecurityOrigin, initiatedBy frame: WKFrameInfo) async -> WKPermissionDecision
```

## Parameters

`frame`

The frame that initiated the request.

`decisionHandler`

The decision handler to call once the app has made its decision.

## Discussion\abstract Allows your app to determine whether or not the given security origin should have access to geolocation APIs.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)