兼容UIWebView和WKWebView
function iOSFunc(apiName, msg) {
if (apiName === 'nativeShare') {
try {
nativeShare(msg);
} catch (error) {
console.log(error)
}
try {
window.webkit.messageHandlers.nativeShare.postMessage(msg);
} catch(error) {
console.log(error)
}
}
}
网友评论