For the complete documentation index, see llms.txt. This page is also available as Markdown.

getPermission

函数式 API getPermission也可以这样使用同样的功能。

功能说明

获取权限的当前状态。不显示系统权限请求 UI,只确认状态。如果用户尚未对权限请求作出响应 notDetermined则返回。

框架使用的代表性的 name/access 组合如下。

name
access

clipboard

read, write

contacts

read

photos

read

geolocation

access

camera

access

microphone

access

类型

getPermission(permission: { name: PermissionName; access: PermissionAccess }): Promise<PermissionStatus>;

Params

type PermissionName =
  "clipboard" | "contacts" | "photos" | "geolocation" | "camera" | "microphone";

type PermissionAccess = "read" | "write" | "access";

Response

示例代码

这有帮助吗?