electron中消息推送的一种实现

3/23/2021 JavaScript

# 消息推送

  1. 在 windows 上使用schtasks (opens new window)注册计划任务。 使用计划任务唤起消息进程

  2. 使用 go 实现一个消息进程。用于唤起主进程,比如:electron.exe --mesage --width 300 --height 500 --url xxxxxx

  3. electron 的主进程根据参数区分启动渲染窗口逻辑 参数格式: --mesage --width 300 --height 500 --url xxxxxx

  4. push-windows 消息页面。根据上述参数启动消息窗口

ps: 由于客户端的安装目录不一致,可以采用查询注册表的方法,找到.exe 程序的安装 目录。参考 (opens new window)

Last Updated: 2/21/2022, 11:35:56 AM