RN webview 内地图有交互处理

react native webview的实现方法

render() {
        return (
           
        )
    }

只写上面的会展示webview,但是没办法获取到用户的详细定位,还需要在当前界面添加以下方法

javascriptToInject = () => {
        return `
          $(document).ready(function() {
            $('a').click(function(event) {
              if ($(this).attr('href')) {
                var href = $(this).attr('href');
                window.webView.postMessage('Link tapped: ' + href);
              }
            })
          })
        `
    }

你可能感兴趣的:(RN webview 内地图有交互处理)