Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
Microsoft Teams tab sample app for demonstrating device permissions
office-teams
office
office-365
nodejs
contentType createdDate
samples
07/27/2021 12:00:00 AM
officedev-microsoft-teams-samples-tab-device-permissions-nodejs

Tab Device Permission Demo

This sample shows tab device permissions.

It also shows Device permissions for the browser. Please refer Device permissions for browser for more information.

Mobile View

Mobile Demo 1

Mobile Demo 2

Mobile Demo 3

Desktop View Desktop View

The latest update on how device permissions are handled in the browser is currently available in public developer preview
only.

This update will be generally available (GA) by February 01, 2022

Prerequisites

  • Microsoft Teams is installed and you have an account (not a guest account)
  • NodeJS
  • ngrok or equivalent tunneling solution
  • M365 developer account or access to a Teams account with the appropriate permissions to install an app.

To try this sample

  1. Clone the repository

    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
  2. In the folder where repository is cloned navigate to samples/tab-device-permissions/nodejs.

  3. Install modules

    Inside node js folder, open your local terminal and run the below command to install node modules. You can do the same in Visual studio code terminal by opening the project in Visual studio code

    npm install

    If you face any dependency error while installing node modules, try using below command

    npm install --legacy-peer-deps
  4. Run the application in your local terminal (or Visual Studio Code terminal) using following command

    npm start
  5. Begin your tunnelling service to get an https endpoint. For this example ngrok is used. Start an ngrok tunnel with the following command (you'll need the https endpoint to update the manifest file):

    ngrok http 3000 --host-header=localhost
  6. Create an app manifest. Navigate to the file, appPackage/manifest.json and change the following:

    1. <<BASE_URI_DOMAIN>> to your https endpoint from ngrok excluding the "https://" part
    2. Save the file and zip this file along with both the png icons (located next to it) together to create a manifest.zip file.
  7. Upload the manifest.zip to Teams (in the left-bottom Apps view, click "Upload a custom app") ans start using the app.

Local Running App:

  1. Upload an app package (Zip file created in step 3 above) to Microsoft Teams Install App

  2. Go to Device permission tab.

  3. Click on respective button to test the scenario. You will get prompt to accept permission request. Accept Permissions

  4. Try this on Mobile. Screenshot of available features:
    Mobile Demo

  5. Device permissions on browser

Desktop View

Error View

Permission View

Final View

Similary, you can try out for other features.

Important

Please take a look at notes section in Device Permissions documentation as not all devices support these permissions.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.