How should you define the toast notification?

DRAG DROP
You are developing a Windows Store alarm clock app.
When an alarm is triggered, the app must present a toast notification that plays a repeating
audio alert until dismissed.
You need to ensure that the repeating audio alert is played.
How should you define the toast notification? (To answer, drag the appropriate code
segments to the correct locations in the answer are
a. Each code segment may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.)

DRAG DROP
You are developing a Windows Store alarm clock app.
When an alarm is triggered, the app must present a toast notification that plays a repeating
audio alert until dismissed.
You need to ensure that the repeating audio alert is played.
How should you define the toast notification? (To answer, drag the appropriate code
segments to the correct locations in the answer are
a. Each code segment may be used once, more than once, or not at all. You may need to
drag the split bar between panes or scroll to view content.)

Answer:

Explanation:
Note: In the case of a long-duration toast notification, the sound can be looped rather than
playing only once. Note that looping audio is only valid for long-duration toasts. Specific
sounds for use with looping are included in the system-specified sound set. This example
specifies a looping sound.
JavaScript
toastNode.setAttribute(“duration”, “long”);
var audio = toastXml.createElement(“audio”);
audio.setAttribute(“src”, “ms-winsoundevent:Notification.Looping.Alarm”);
audio.setAttribute(“loop”, “true”);
Reference: Quickstart: Sending a toast notification (Windows Store apps using JavaScript
and HTML) (Windows)



Leave a Reply 0

Your email address will not be published. Required fields are marked *