0

I'm using the below approach to access the camera & gallery from an MSTeams app.

Link: Access device permissions

I'm facing 2 errors, Error 1: 1000App doesn't have sufficient permission to use this API This is when i dont use "navigator.permissions.query({ name: 'camera' });" If i use the above navigator permission to prompt the permission alert i get the 2nd warning/exception ie Error 2: Exception Cannot read properties of undefined (reading 'query')

Can some please help..!

user2250152
  • 14,658
  • 4
  • 33
  • 57
Raghavendra
  • 101
  • 2
  • Above error has been fixed in sample by moving that code into separate JS and calling that JS function wherever needed. https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/tab-device-permissions/nodejs/src/NavigatorPermission.js Can you please check this out once. – Meghana-MSFT Dec 27 '22 at 06:43
  • @Meghana-MSFT No luck.. I'm still facing the same issue. FYI, Mine is a **javascriprt tab app**(not typescript). Do you have any working sample..? – Raghavendra Dec 27 '22 at 10:32
  • Can you please let us know how and from where you are calling navigator.permissions.query({ name: "camera" })? Currently we do not have a working sample in Javascript for device permissions. – Meghana-MSFT Dec 29 '22 at 09:55
  • @Meghana-MSFT I have created a navigatorPermisson.js likewise u suggested and calling in my javascript(jsx) – Raghavendra Dec 30 '22 at 10:12
  • Can you please share your complete javascript code base repo at microsoftteamsdev@microsoft.com – Meghana-MSFT Jan 09 '23 at 15:49

0 Answers0