tauri-apps / tauri-apps/plugins-workspace

[question] Tauri plugin that auto grants DeviceOrientationAndMotion Permission on iOS

Open
#2,916 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

I have the following code snippet in a plugin that automatically grants permissions when JavaScript logic calls `DeviceOrientationEvent.requestPermission()`:

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

This generally, but there is a brief flash of transparent gray on the screen as if the normal prompt were to appear.

I'm just curious if anyone has gotten around this or used different approaches for handling certain WebView permissions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.