【问题标题】:Microsoft Teams Custom Tab Application - geolocation issueMicrosoft Teams 自定义选项卡应用程序 - 地理位置问题
【发布时间】:2021-07-31 21:01:49
【问题描述】:

我使用 Microsoft Teams Toolkit for VS Code 创建了一个自定义团队应用程序。我正在尝试从应用程序中读取位置。我可以在浏览器和 Android 版本的团队中加载坐标,但在桌面版本的团队中失败并出现以下错误。

Network location provider at 'https://www.googleapis.com/' : No response received.

加载Location的函数-

 const getLocation = () => {
      let that = this;
      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition((position) => {
          alert('got position');
          var positionInfo = "Your current position is (Latitude: " + position.coords.latitude + ", Longitude: " + position.coords.longitude + ")";
           alert(positionInfo);
        }, (error) => {
          alert("Error: " + error.message);
        }, { timeout: 30000, enableHighAccuracy: true, maximumAge: 75000 });
      } else {
        alert("Geolocation is not supported by this browser.");
      }
    }

navigator.geolocation().getCurrentPosition API 可能有问题。这方面的任何线索都会很有用。

【问题讨论】:

    标签: javascript geolocation microsoft-teams google-geolocation


    【解决方案1】:

    我会让这个问题出现在任何人寻找答案或者如果有人找到更新的地方。

    我发现这个来自 MSFT 的官方文档指出,目前团队桌面客户端不完全支持地理定位 API,他们建议使用 TeamsSDK 的 getLocation API。

    https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/device-capabilities/native-device-permissions?tabs=desktop

    【讨论】:

      猜你喜欢
      • 2023-04-10
      • 1970-01-01
      • 2021-05-18
      • 1970-01-01
      • 1970-01-01
      • 2023-01-11
      • 2023-02-02
      • 1970-01-01
      • 2021-04-30
      相关资源
      最近更新 更多