Tauri sendNotification
2024-02-02 17:21 更新
sendNotification(: |Options
):options
string
void
向用户发送通知。
例
import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification';
let permissionGranted = await isPermissionGranted();
if (!permissionGranted) {
const permission = await requestPermission();
permissionGranted = permission === 'granted';
}
if (permissionGranted) {
sendNotification('Tauri is awesome!');
sendNotification({ title: 'TAURI', body: 'Tauri is awesome!' });
}
Since: 1.0.0
参数
名字 | 类型 |
---|---|
options | string | 选项 |
Returns: void
以上内容是否对您有帮助:
更多建议: