'screen remains black after given access in swift ios
I have an app which is basically loading a website or to be exact a search engine like google. This kind of search engine has some functionalities like saving products and also scan them over barcode scanner with webrtc. There I have persistent problem that i'm not really able to use the cam when I tap the area to activate it. After it asks for permission it remains black.
//
// ViewController.swift
// WETID.de
//
// Created by user931404 on 12/11/21.
//
import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {
var webView: WKWebView!
override func loadView() {
let config = WKWebViewConfiguration()
webView=WKWebView(frame: .zero, configuration: config)
webView.navigationDelegate=self
view = webView
config.allowsPictureInPictureMediaPlayback = true
config.allowsInlineMediaPlayback = true
}
@IBOutlet var webview: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://wetid.de")!
webView.load(URLRequest(url: url))
webView.allowsBackForwardNavigationGestures = true
// Do any additional setup after loading the view.
}
}
I tried many solutions like changing the structure and add some new configs as well as adding additonal options in info.plist but without success, does anybody know a better solution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
