首页 > 解决方案 > 场景设置为“incomingCall”的 Windows 10 Toast 通知扰乱了通知 UI

问题描述

我正在开发一个使用 NodeRT 在 Windows 10 中显示 toast 通知的 Electron 应用程序。到目前为止,我的工作正常,并且“ToastGeneric”通知显示正常。

该应用程序应在收到来电时向用户显示通知。

一个普通的吐司就可以了:

普通吐司

但是,如果我在 中添加一个scenario="incomingCall"<toast>它会弄乱 UI。

Toast 作为incomingCall

我在任何地方都找不到有关此行为的任何适当文档。我什至尝试使用 Microsoft 提供的代码示例,但这也不起作用。

知道这哪里出错了吗?

这是我的吐司有效载荷:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>%s</text>
            <text>%s, %s</text>
            <group>
            <subgroup>
                <text hint-style="base">52 attendees</text>
                <text hint-style="captionSubtle">23 minute drive</text>
            </subgroup>
            <subgroup>
                <text hint-style="captionSubtle" hint-align="right">1 Microsoft Way</text>
                <text hint-style="captionSubtle" hint-align="right">Bellevue, WA 98008</text>
            </subgroup>
            </group>
        </binding>
    </visual>
    <actions>
        <action arguments = 'answer'
                content = 'answer' />
        <action arguments = 'ignore'
                content = 'ignore' />
    </actions>
</toast>

标签: node.jsnotificationselectrontoastwindows-10-desktop

解决方案


根据@Richard Zhang 提供的建议,我在 Notifications Visualizer 中试用了该模板。

它产生了与我通过 NodeRT 看到的相同的混乱 UI。似乎该incomingCall场景强制要求模板在正文之后提供两个(或三个,我不记得确切)按钮。然后是最后一行,带有“回答”和“拒绝”按钮。

能够使用这种场景真的很酷,但是,我不得不使用常规的 toast 通知。


推荐阅读