Hi, it seems that with iOS26 the system displays two entries in the screentime report for apps that use a WKWebView: one for the app itself and one for the website that was displayed in the app. We don't see this behaviour in iOS18.7.
I'm reseaching how to disable the recording for the webviews in one of our apps (written in Swift with UIKit). The STWebpageController looked promising, especially the field suppressUsageRecording, but the whole class is poorly documented.
We initialized it with the bundle identifier of the app and set the url of the wkwebview as the url in STWebpageController. It looks a bit like this:
webView = WKWebView(frame: .zero, configuration: config)
view.addSubview(webView)
//setup STWebpageController
webpageController = STWebpageController()
do {
try webpageController!.setBundleIdentifier(bundleIdentifier)
} catch{
}
webpageController!.suppressUsageRecording = true
addChild(webpageController!)
view.addSubview(webpageController!.view)
webpageController!.view.frame = view.frame
webpageController!.didMove(toParent: self)
//load url in webView
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData)
webview.load(request)
webpageController?.url = request.url
This has no effect on the recorded screentime for the webview inside our app - we still see the same time for the container app and the included webview.
Any suggestions?
Thanks, Heiko