简体   繁体   English

Microsoft Teams 自定义选项卡应用程序 - 地理位置问题

[英]Microsoft Teams Custom Tab Application - geolocation issue

I created a custom teams application using Microsoft Teams Toolkit for VS Code.我使用 Microsoft Teams Toolkit for VS Code 创建了一个自定义团队应用程序。 I am trying to read the location from the app.我正在尝试从应用程序中读取位置。 I am able to load the coordinates in the Browser and Android version of teams but it fails in the Desktop version of teams with the below error.我能够在浏览器和团队的 Android 版本中加载坐标,但在团队的桌面版本中失败并出现以下错误。

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

The function to load the Location- function 加载位置-

 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.");
      }
    }

It might be a problem with the navigator.geolocation().getCurrentPosition API. navigator.geolocation().getCurrentPosition API 可能有问题。 Any leads on this will be useful.这方面的任何线索都会很有用。

I will let this question be here for anyone looking for an answer or if anyone finds an update to this.我会让这个问题出现在这里,任何人都在寻找答案,或者如果有人发现了这个问题的更新。

I found this official documentation from MSFT that states geolocation API is not fully supported in the teams desktop client currently and they suggest using the getLocation API of TeamsSDK.我发现这个来自 MSFT 的官方文档指出地理位置 API 目前在团队桌面客户端中不完全支持,他们建议使用 TeamsSDK 的 getLocation API。

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

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft 团队自定义选项卡,向用户的活动源发送通知 - Microsoft teams custom tab, sending notification to user's activity feed 如何调试在 android 移动团队应用程序的 microsoft 团队选项卡中执行的 javascript 代码? - How can I debug javascript code that is being executed inside microsoft teams tab of android mobile teams application? MIcrosoft Teams 自定义应用商店 accessToken - MIcrosoft Teams Custom App store accessToken 从自定义团队应用程序选项卡将文件上传到团队 onedrive - Uploading a file to the teams onedrive from custom teams app tab 自定义团队应用程序选项卡仅在浏览器中工作 - Custom teams app tab working only in browser 在添加到频道期间,Microsoft Teams选项卡无法保存设置 - Microsoft Teams tab is unable to save settings during the adding to a channel Microsoft Teams 选项卡 http/https 不发送请求 - Microsoft Teams tab http/https does not send request 在外部选项卡 url 应用程序中访问 Teams 会话和其他信息 - Access Teams session and other information in external tab url application 即使选项卡不清晰,仍从Web应用程序发送地理位置信息? - Sending Geolocation from a Web Application even when the tab is not in focus? 来自@azure/msal-browser 的 loginPopup 不适用于 Microsoft Teams 桌面应用程序 - loginPopup from @azure/msal-browser not working on Microsoft Teams desktop application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM