Im trying to update our application to be iOS 10 compatible (swift 2.3 for now, XWebView version 0.10.0).
Calls to methods in a XWVScripting class that use promises do not get fired.
Example:
XWVScripting class:
class Bridge : NSObject, XWVScripting{
func getData(promiseObject promise: XWVScriptObject){
promise.callMethod("resolve", withArguments: ["hello"], completionHandler: nil);
}
class func scriptNameForSelector(selector: Selector) -> String? {
if(selector.description == "getDataWithPromiseObject:"){
return "getData";
}
return nil;
}
}
Webpage:
<html>
<head>
<meta name='viewport' content='width=device-width' />
<script type="text/javascript">
var writeLine = function(line) {
var divCont = document.getElementById("testDiv");
divCont.innerHTML += line + "<br/>";
}
var run = function(){
bridge.getData().then(function(result){
writeLine(result);
});
};
</script>
</head>
<body>
<br />
<input type="button" value="GO" onclick="run()" />
<br />
<div id="testDiv"></div>
</body>
</html>
The application works fine in iOS 9, but not in iOS 10
Im trying to update our application to be iOS 10 compatible (swift 2.3 for now, XWebView version 0.10.0).
Calls to methods in a XWVScripting class that use promises do not get fired.
Example:
XWVScripting class:
Webpage:
The application works fine in iOS 9, but not in iOS 10