mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-07 21:22:34 +01:00
🎨 Support sending notifications on HarmonyOS https://github.com/siyuan-note/siyuan/issues/17125
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
51295adb4b
commit
5d98257e51
3 changed files with 7 additions and 2 deletions
|
|
@ -28,6 +28,10 @@ export const onMessage = (app: App, data: IWebSocketData) => {
|
|||
if (window.JSAndroid.sendNotification) {
|
||||
window.JSAndroid.sendNotification(data.data.channel, data.data.title, data.data.body, data.data.delayInSeconds);
|
||||
}
|
||||
if (window.JSHarmony.sendNotification) {
|
||||
window.JSHarmony.sendNotification(data.data.channel, data.data.title, data.data.body, data.data.delayInSeconds);
|
||||
}
|
||||
|
||||
break;
|
||||
case "backgroundtask":
|
||||
if (!document.querySelector("#keyboardToolbar").classList.contains("fn__none") ||
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -274,6 +274,7 @@ interface Window {
|
|||
getScreenWidthPx(): number
|
||||
exit(): void
|
||||
setWebViewFocusable(enable: boolean): void
|
||||
sendNotification(channel: string, title: string, body: string, delayInSeconds: number): void
|
||||
};
|
||||
|
||||
Protyle: import("../protyle/method").default;
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ func sendDeviceNotification(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if util.ContainerAndroid != util.Container {
|
||||
if util.ContainerAndroid != util.Container && util.ContainerHarmony != util.Container {
|
||||
ret.Code = -1
|
||||
ret.Msg = "Just support Android"
|
||||
ret.Msg = "Just support Android and HarmonyOS"
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue