askForSitePermission

abstract fun askForSitePermission(activity: Activity, url: String, tabId: String, permissionsRequested: SitePermissionsManager.SitePermissions, request: PermissionRequest, permissionsGrantedListener: SitePermissionsGrantedListener)

This method should be called if website requests site permissions (audio or video). It will launch dialogs flow for asking the user.

Parameters

activity

where this method is called from

url

URL taken from the permissions request object

tabId

id from the tab where this method is called from

permissionsRequested

maps of permissions where keys are the type PermissionsKey and have a list of String as values.

request

from onPermissionRequest callback in BrowserChromeClient. It is needed to grant site permissions.

permissionsGrantedListener

interface that fragment or activity needs to implement to handle special cases when granting permissions