前端调用 原生app 方法,通过 iframe 唤起 native
if( navigator.userAgent.indexOf(‘iPhone‘) >= 0 ) { ???var ifr = document.createElement(‘ifrmae‘); ???ifr.src = ‘xx://postToken‘; ???ifr.style.display = ‘none‘; ???document.body.appendChild(ifr);}// 执行完成后的回调function sendTokenToWrap ( token ) { ???// 返回值 ???alert( token )}
js 调用原生方法
原文地址:https://www.cnblogs.com/_error/p/9198396.html