We were able to solve the problem with:
let configuration = WKWebViewConfiguration()
let contentController = WKUserContentController()
let script = WKUserScript(
source: #"window._platformProperties = {"os":"ios","capabilities":["brightness","contactInformation","location","push","share","storage","userRating"]}"#,
injectionTime: .atDocumentStart,
forMainFrameOnly: true
)
contentController.addUserScript(script)
configuration.userContentController = contentController
let webView = WKWebView(frame: .zero, configuration: configuration)
...more code
It was tricky to tackle, as in previous versions it worked when we called evaluateJavaScript() at any time.
With the changes in Xcode 13 / iOS 15 we tried calling it after webview.load(_ urlRequest: URLRequest), that still was to early.
We tried calling evaluateJavascript() in:
webView(_ webView: WKWebView, didFinish navigation: WKNavigation?)
That was too late.
The webview requires our "window._platformProperties" to be present in order to load.
Only after using a WKUserScript it works, as it is executed just at the right time.
Post
Replies
Boosts
Views
Activity
Xcode cloud is not a replacement for all of us. I don't think, that the corporation, which I work for, will ever grant other companies access to the apps source code. :-(
How can I make those feedback assistant links work for me? If I click the above link, I do not see the issue. The only thing I ever get on these kind of links is "Feedback Not Found".
Removed comment to wrong thread
Unfortunately I can not test it on the machines, which have the problem, as both must stay able to build releases. I can not build releases with Beta software. But I am desperately waiting for this fix for such a long time now, that I'll setup another machine with 12.3, just to see the Xcode Server start finally! :-)
Thank you so much for addressing this bug!
Great news! Can't wait for the release of 12.3...
Thank you so much for your help, @eskimo
Very much appreciated.
While it works at first, unfortunately the connection still drops after a while, even if I started debugging in flight mode. :-(
The app is terminated, so I can not even re-attach it to the debugger, as the app session is terminated and this the app is restarted. But even after restarting the app and trying to attach it to the debugger Xcode stays for ever in "Waiting to attach to AppName on iPhone" mode.
I will test further, whether it is something specific to my app.
But meanwhile I will file a bug as suggested nonetheless.
We should really be able to decide ourselves, whether the cable is used for debugging or not.
Thanks for taking the time.
Filed a bug. Bug ID: FB13467533