PermissionHandler
PermissionHandler
#
Bases: Service
Manages permissions for the application.
This control is non-visual and should be added
to Page.services
list.
Platform support
Currently only supported on Android, iOS, Windows, and Web platforms.
RAISES | DESCRIPTION |
---|---|
FletUnsupportedPlatformException
|
If the platform is not supported. |
parent
#
parent: BaseControl | None
The direct ancestor(parent) of this control.
It defaults to None
and will only have a value when this control is mounted
(added to the page tree).
The Page
control (which is the root of the tree) is an exception - it always
has parent=None
.
build
#
Called once during control initialization to define its child controls. self.page is available in this method.
get_status
#
get_status(
permission: Permission, timeout: int = 10
) -> PermissionStatus | None
Gets the current status of the given permission
.
PARAMETER | DESCRIPTION |
---|---|
permission
|
The
TYPE:
|
timeout
|
The maximum amount of time (in seconds) to wait for a response.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
PermissionStatus | None
|
A |
RAISES | DESCRIPTION |
---|---|
TimeoutError
|
If the request times out. |
open_app_settings
#
Opens the app settings page.
PARAMETER | DESCRIPTION |
---|---|
timeout
|
The maximum amount of time (in seconds) to wait for a response.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
|
RAISES | DESCRIPTION |
---|---|
TimeoutError
|
If the request times out. |
request
#
request(
permission: Permission, timeout: int = 60
) -> PermissionStatus | None
Request the user for access to the permission
if access hasn't already been
granted access before.
PARAMETER | DESCRIPTION |
---|---|
permission
|
The
TYPE:
|
timeout
|
The maximum amount of time (in seconds) to wait for a response.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
PermissionStatus | None
|
The new |
RAISES | DESCRIPTION |
---|---|
TimeoutError
|
If the request times out. |