To find the location of the user, I wrote the below code:
geoLocation.getCurrentLocation() .then((res) => {
console.log({ "Execute getCurrentLocation": res }); }) .catch((error) => { console.log({ "error while Execute getCurrentLocation ": error }); });
but I get the following error 'one or more provided argument is invalid' when the api gets called. This error is also mentioned on the official site of Microsoft (Error code - 4000).
can you help me to resolving this error
The TeamsJS library provides getLocation API that you can use to fetch the current location of the user.
The location is returned in the callback function as a Location object, which contains the latitude and longitude of the user's location.
Also, you need to update your app's manifest file to include the devicePermissions field with the geolocation permission.
Sample Ref: https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/app-checkin-location