適応型かつ対話型のトースト通知に外部 Web サーバのリソースを含む場合、トースト通知が表示されないことがある / Toast notifications with external web server resources may not work

English Version Follows

こんにちは、Platform SDK (Windows SDK) サポートチームです。

今回は、Windows 10 にて新しくサポートされた、適応型かつ対話型のトースト通知 (Adaptive and interactive toast notifications) を使用した場合の現象についてお知らせします。

 

概要

Windows 10 では、トースト通知をカスタマイズして、以下のように、テキスト、画像、およびカスタム操作を表示することができます。

toast

XML 形式を用いたより見栄えのよい通知を生成するための柔軟なスキーマや、簡単な操作を行えるトースト通知を作成する手段が提供されています。

詳細については、以下のブログをご確認ください。

Adaptive and interactive toast notifications for Windows 10
<https://blogs.msdn.com/b/tiles_and_toasts/archive/2015/07/02/adaptive-and-interactive-toast-notifications-for-windows-10.aspx>

このトースト通知を利用した場合、通知内に外部サーバの URL を含む画像が含まれていると、トースト通知が配信されているにもかかわらず表示されないことがあります。

具体的には 20 件目までの通知は、トースト通知が表示されますが、21 件目以降の通知は表示されない動作になっています。

 

現象

この現象は次の手順で再現できます。

  1. トースト通知の内容を次の内容で設定する。

     <toast>
      <visual>
        <binding template="ToastGeneric">
          <text>Text</text>
          <image src="https://fabrikam.com/image.png" />
        </binding>
      </visual>
    </toast>
    
  2. トースト通知を 21 件送信する。
    この時点で、アクション センターに表示される通知があふれます。

  3. さらにトースト通知を送信する。

この場合、3. にて送信したトースト通知は、表示されません。
ただ、アクション センターには追加されます。

 

原因

本動作は、Windows 10 における仕様です。

トースト通知の処理では、Web サーバーから画像をダウンロードする場合の特別な処理があり、21 件目以降の通知はトースト通知が表示されないような動作になっています。

 

対処方法

前述の手順 1. の場合、image に指定する URL がアプリケーション パッケージ内のファイルの場合や、image が含まれないなどの場合はこの問題は発生しません。

トースト通知を頻繁に表示するアプリケーションでは、全ての通知が行われない可能性があるため、Web サーバー上の画像を利用するのではなく、ローカル PC 内の画像を使用するなどご検討ください。

 

Summary

In Windows 10, you are able to customize the toast notifications by adding content such as text and images.  A flexible schema, using XML, is provided that enables creation of toast notifications with enhanced content and interactive toast notifications.  This article describes a behavior where such toast notifications would not display under certain circumstances.

 

Symptoms

Consider the following scenario, where a toast notification contains an image obtained from an external server URL.

  1. Create a toast notification such as the one below, containing an external URL.

     <toast>
      <visual>
        <binding template="ToastGeneric">
          <text>Text</text>
          <image src="https://fabrikam.com/image.png" />
        </binding>
      </visual>
    </toast>
    
  2. Send 20 of the toast notifications created in Step 1.  At this point, the Action Center will reach the maximum capacity of notifications it can store.

  3. Send another instance of the toast notification created in Step 1.

 

Cause

Windows 10 undergoes a specific sending process for toast notifications which requires downloading an image from a web server.   For such a process, notifications that are sent after the Action Center reaches max capacity are not displayed.

 

Workaround

This behavior will not be seen if the toast notification includes an image from within the application package, or does not contain an image at all.  For applications which frequently sends toast notifications, please consider using locally saved images instead of images from web servers to avoid this behavior.

 

Status

Microsoft acknowledges this behavior as by design.

 

More Information

Additional information on adaptive and interactive toast notifications can be seen below.

Adaptive and interactive toast notifications for Windows 10
<https://blogs.msdn.com/b/tiles_and_toasts/archive/2015/07/02/adaptive-and-interactive-toast-notifications-for-windows-10.aspx>