api
notification
查看 Markdown向系统通知区域发送标题与正文。
向系统通知区域发送标题与正文。
notification 只发送短文本通知,不处理通知点击跳转、操作按钮、图标资源或通知分组。
实现入口是 frontend/src/api/notification.ts。
| 方法 | 权限 | Windows | Android |
|---|---|---|---|
| show | notification.show | 支持 | 支持,Android13+需运行时授权 |
Windows 对已注册权限直接返回 granted。Android13 及以上需要先请求
POST_NOTIFICATIONS:
const permission = await KSM.permission.request('notification.show');
if (!permission.granted) {
return;
}
await KSM.notification.show({
title: 'Kasumi',
body: '后台任务已完成'
});permission.request 会更新宿主权限集合,但前端 capabilities() 缓存不会自动刷新。
评论