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
예시 코드
도움이 되었나요?