收藏
回答

IOS 16.4 navigator.geolocation.getCurrentPosition

 getLocation2(timeout, cacheTimeout) {
    console.log('[ getLocation2 test..... ]::-188')
    let timeId;
    setTimeout(() => {
      console.log("[ getLocation2 timeout ]::-190  ", timeout, "s");
    }, timeout);
    try {
      navigator.geolocation.getCurrentPosition(
        (position) => {
          clearTimeout(timeId);
          console.log("[ getLocation2 success] ::", position);
        },
        (e) => {
          clearTimeout(timeId);
          console.log("[ getLocation2 fail] ::", e);
        },
        {
          timeout: timeout * 1e3,
          maximumAge: cacheTimeout * 1e3,
        }
      );
    } catch (error) {
      console.log('[ getLocation2 error ]::-207', error)
    }
  }


IOS 16.4 系统中小程序webview&app webview中内嵌H5 navigator.geolocation.getCurrentPosition无响应(超时),必现;



最后一次编辑于  2023-04-07
回答关注问题邀请回答
收藏

4 个回答

登录 后发表内容