100ms Logo

100ms

Docs

Search docs
/

Strict Privacy Applications

Strict Privacy Applications are those applications which ask for permissions as & when required thus following something similar to principle of least privilege.

Steps to create a strict privacy application:

  1. Join in a role without video permissions.

Create three roles with permissions as:

  • Host

host

  • Guest

guest

  • Viewer

viewer

These roles are just for examples. User can create their own roles based on use cases.

  1. If role of user is changed to a role which has audio-video publishing permission then ask for permissions as:
void onRoleChangeRequest({required HMSRoleChangeRequest roleChangeRequest}) { if(roleChangeRequest.suggestedRole.publishSettings?.allowed.contains("video")??false){ //if video permissions are not available await Permission.camera.request(); } if(roleChangeRequest.suggestedRole.publishSettings?.allowed.contains("audio")??false){ //if audio permissions are not available await Permission.microphone.request(); //if bluetooth permissions are not available await Permission.bluetoothConnect.request(); } //if the application have required permissions hmsSDK.acceptChangeRole(roleChangeRequest); }

This is applicable only when user asks for permission while changing role. In case of force role change the application is required to have permissions before the role change.