Closed timwright35 closed 8 years ago
Anyone have the solution?
Not yet, I have been working on figuring it out
I changed my function to: (It gives warnings but seems to work for me, likely needs someone else to update it better)
func evaluateJs (script: String) {
if webView != nil {
if let uiWebView = webView! as? UIWebView {
uiWebView.stringByEvaluatingJavaScriptFromString(script)
} else if let wkWebView = webView as? WKWebView {
wkWebView.evaluateJavaScript(script, completionHandler: nil)
}
} else {
log("webView is null")
}
}
@Tempus35 Are you using Cordova IOS 4 and therefore maybe wkWebView ? If so, I can confirm that things are working. If you are using uiWebView, I do not know then but I am sure someone else can feedback,
I have ios 3.9.2 it seems
cordova platforms ls
will let you know which version you are using for ios.
If it is < 4, you are definitively using uiWebView.
Not the answer to your problem, but wkWebView brings a nice speed improvement, you can consider upgrading (just make sure you other plugins have been upgraded by their authors to be compatible with it)
Yes I am less than 4 but at the time this app is on crunch time and being it is working fine except for some slight issues with geofencing on iOS I am not going to try to upgrade yet.
@Tempus35, for reasons explained here https://github.com/cowbell/cordova-plugin-geofence/issues/127, I had to stop using wkWebView and went back to uiView. I can now confirm your bug and the fix you mentioned above.
@johnrobertcobbold Good to know
As the title says, there is a code error in the executeJS function for the new iOS code, I have tried fixing it but apparently I do not know swift2 very well.