openPermissionDialog
Functional API
openPermissionDialogYou can use the same function with this as well.
Feature description
Opens a permission request dialog and returns the result. Use this when requesting permission from the user again after it has already been denied.
Type
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";Example code
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'
}Was this helpful?