Skip to content
My custom sidebar

通知

使用各平台的通知系统发送本地通知。

使用方法

typescript
import { sendNotification } from "perry/system";

sendNotification("Download Complete", "Your file has been downloaded successfully.");

平台实现

平台底层实现
macOSUNUserNotificationCenter
iOSUNUserNotificationCenter
AndroidNotificationManager
WindowsToast notifications
LinuxGNotification
WebWeb Notification API

权限说明:在 macOS、iOS 和 Web 平台上,用户可能需要授予通知权限。首次使用时,系统会自动弹出权限请求提示。

后续参考

MIT License.