前端调用 原生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 )
}

 

相关文章:

  • 2022-12-23
  • 2021-08-12
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-06-11
  • 2021-12-10
  • 2022-12-23
相关资源
相似解决方案