Skip to content

Commit

Permalink
feat(ios): Add new iOS 15 Motion permission delegate (#5317)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jan 5, 2022
1 parent 26261fb commit c05a3cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ios/Capacitor/Capacitor/WebViewDelegationHandler.swift
Expand Up @@ -59,6 +59,14 @@ internal class WebViewDelegationHandler: NSObject, WKNavigationDelegate, WKUIDel
) {
decisionHandler(.grant)
}

@available(iOS 15, *)
func webView(_ webView: WKWebView,
requestDeviceOrientationAndMotionPermissionFor origin: WKSecurityOrigin,
initiatedByFrame frame: WKFrameInfo,
decisionHandler: @escaping (WKPermissionDecision) -> Void) {
decisionHandler(.grant)
}
#endif

public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
Expand Down

0 comments on commit c05a3cb

Please sign in to comment.