iOS 14 has this API, however how can this be achieved in iOS 13 or below?
For example, suppose the JS has a function defined as:
function upperCaseAsync(text) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(text.toUpperCase());
}, 300);
});
}
How to call and handle the resulting promise's result? I tried using the synchronous API, but it throws an error:
Error Domain=WKErrorDomain Code=5 "JavaScript execution returned a result of an unsupported type"