我正在尝试处理我的应用程序中的深度链接(electron@20.1.3,electron-builder@23.1.0)。总的来说,它工作(至少在MacOS上)很好,但当我完全关闭我的应用程序,并试图打开应用程序与深度链接应用程序打开,但没有深度链接的行为。
我使用Official Documentation中的代码来解决这个问题,但是我看不到任何代码行。
第一个
我正在尝试处理我的应用程序中的深度链接(electron@20.1.3,electron-builder@23.1.0)。总的来说,它工作(至少在MacOS上)很好,但当我完全关闭我的应用程序,并试图打开应用程序与深度链接应用程序打开,但没有深度链接的行为。
我使用Official Documentation中的代码来解决这个问题,但是我看不到任何代码行。
第一个
1条答案
按热度按时间lymnna711#
想通了!
我的错误是我在
ipcMain
中添加事件侦听器的时间太晚了,因为我使用的是app.whenReady
,而不是app.on("open-url")
。看起来
app.whenReady
比app.on("open-url")
更早触发,应用程序失去了侦听app.on("open-url")
和获取运行应用程序附带的事件的机会。最终代码是这样的: