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

openPermissionDialog

함수형 API openPermissionDialog으로도 같은 기능을 쓸 수 있어요.

기능 설명

권한 요청 다이얼로그를 열고 결과를 반환해요. 권한이 이미 거부된 상태에서 사용자에게 권한을 다시 요청할 때 사용해요.

타입

openPermissionDialog(permission: { name: PermissionName; access: PermissionAccess }): Promise<PermissionDialogResult>;

Params

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

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

Response

type PermissionDialogResult = "allowed" | "denied";

예시 코드

import {
  getPermission,
  openPermissionDialog,
} from "@apps-in-toss/web-framework";

const status = await getPermission({ name: "photos", access: "read" });

if (status === "denied") {
  const result = await openPermissionDialog({
    name: "photos",
    access: "read",
  });
  console.log(result); // 'allowed' | 'denied'
}

도움이 되었나요?