WKWebView没有在应用程序中要求获得摄像头和麦克风的许可。当我在Safari浏览器中加载相同的url时,它会请求相机和麦克风的许可,并且视频通话效果很好。但是,当我将其嵌入WKWebView权限时,即使在plist文件中同时授予了摄像头和麦克风权限,也不会询问。即使在UIWebViewSafari浏览器视图控制器中,同样的东西也不起作用。我引用了以下链接,但仍然无法正常工作。
在wkwebview中启用“摄像机和麦克风”访问权限,如果用户拒绝访问摄像机,
如何防止WKWebView呈现“摄像机”模式?
有人可以提供任何解决方案吗?
我需要在 MapView 中添加多个标记。如何使用 swiftui 在同一地图视图中添加多个标记?
这是我的代码:
import SwiftUI
import UIKit
import GoogleMaps
struct MapView: UIViewRepresentable {
let coordinate: CLLocationCoordinate2D?
let marker : GMSMarker = GMSMarker()
func makeUIView(context: Self.Context) -> GMSMapView {
let camera = GMSCameraPosition.camera(withLatitude: coordinate.latitude, longitude: coordinate.longitude, zoom: 6.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
return mapView
}
func updateUIView(_ mapView: GMSMapView, context: Self.Context) {
marker.position = CLLocationCoordinate2D(latitude: coordinate.latitude, longitude: coordinate.longitude)
marker.title = "XYZ"
marker.snippet = "ABCD"
marker.map = mapView
}
}
Run Code Online (Sandbox Code Playgroud)