Tauri requestPermission
requestPermission():Promise
<Permission
>
请求发送通知的权限。
例
import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification';
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}
Since: 1.0.0
Returns: Promise
<Permission
>
解决用户是否授予权限的承诺。