Hello All,
Sharing some good collective information on Toast Notifications in Universal Windows Apps.
Sharing some good collective information on Toast Notifications in Universal Windows Apps.
- Types:
Glance(Consume) : Toast like "Update Available" or "New features available"
Act(Chase or take action) :
Toast invite you to begin or complete task
The toast is the app's door by chasing(clicking) on it
Additional actions enable users to perform simple task without context switching
Act(Chase or take action) :
Toast invite you to begin or complete task
The toast is the app's door by chasing(clicking) on it
Additional actions enable users to perform simple task without context switching
- Toast Templates :
All templates are available which was for Windows phone and store apps, now they have merged together.If existing legacy templates doesn't fulfill your needs so new templates are also available.
Adaptive Templates
Adaptive Templates
- Sending Toasts:
Scheduled : Set template and tile with "ScheduledToastNotification",toast can also be set to recurring.
Local : Send from foreground/background app
Push : Use push services
Create interactive toast notifications that enable user interaction.
XML
<visual>: Content available for the users to visually see, including text and images;
<actions>: Buttons/inputs the developer wants to add inside the notification;
<audio>: The sound played when the notification pops.
2) More types of activations through actions
3) No more ToastCapable : Now no need to declare capability that app is toast capable or not.
4) Toasts and Tiles can now get in Sync : In Windows 10, we added the ability for an app to be notified when the app’s collection of notifications is changed in any way that’s not caused by the app’s local client.
5)New Notification Setting behaviour : In Windows 10, only after an app sends a first toast notification, will it be added to the Notifications & Actions section of System Settings, from which the user can disable or enable toast notifications for your app at any time.
Tap>Task launches>retrieve args>Take actions
3)Activation type = protocol
Tap>Protocol activates>Web/app(as per uri match)
4)Activation type = system
Tap>system handles(reminder/alarm)
-Reminder
-Incomming call
One process to register an app for push.
One tile template to push to Windows&phone apps.
Request Channel Uri>Register with your cloud service >Authenticate & Push notification
References : PushTestServer and Sample Code
Tag and group notifications.
Replace a notification with a new one.
Set an expiration on notifications.
Send "Ghost Toast" notifications(only show up in notification center)
Local : Send from foreground/background app
Push : Use push services
void
SendToast()
{
//Make toast
var toastTemplate = ToastTemplateType.ToastText01;
var xml = ToastNotificationManager.GetTemplateContent(toastTemplate);
xml.DocumentElement.SetAttribute(
"launch"
,
"Args"
);
//setting up value
var toastText = xml.CreateTextNode(
"This is Notification Message"
);
var elements = xml.GetElementsByTagName(
"text"
);
elements[0].AppendChild(toastText);
//Showing toast
var toast =
new
ToastNotification(xml);
var toastNotifier = ToastNotificationManager.CreateToastNotifier();
toastNotifier.Show(toast);
}
- Adaptive and Interactive toast :
Create interactive toast notifications that enable user interaction.
XML
<
toast
launch
=
"app-defined-string"
>
<
visual
>
<
binding
template
=
"ToastGeneric"
>
<
text
>Sample</
text
>
<
text
>This is a simple toast notification example</
text
>
<
image
placement
=
"AppLogoOverride"
src
=
"oneAlarm.png"
/>
</
binding
>
</
visual
>
<
actions
>
<
action
content
=
"check"
arguments
=
"check"
imageUri
=
"check.png"
/>
<
action
content
=
"cancel"
arguments
=
"cancel"
/>
</
actions
>
<
audio
src
=
"ms-winsoundevent:Notification.Reminder"
/>
</
toast
>
<actions>: Buttons/inputs the developer wants to add inside the notification;
<audio>: The sound played when the notification pops.
- New Functionalities:
2) More types of activations through actions
3) No more ToastCapable : Now no need to declare capability that app is toast capable or not.
4) Toasts and Tiles can now get in Sync : In Windows 10, we added the ability for an app to be notified when the app’s collection of notifications is changed in any way that’s not caused by the app’s local client.
5)New Notification Setting behaviour : In Windows 10, only after an app sends a first toast notification, will it be added to the Notifications & Actions section of System Settings, from which the user can disable or enable toast notifications for your app at any time.
- Interactive toast :
-Varous activation types can be set.
1)Activation type=foreground
Tap button>app launches>retrieve args>take actions
Tap>Task launches>retrieve args>Take actions
3)Activation type = protocol
Tap>Protocol activates>Web/app(as per uri match)
4)Activation type = system
Tap>system handles(reminder/alarm)
- Special Toast Scenarios: scenario="senario name"
-Reminder
-Incomming call
- Notification Types:
- Tile
- Badge
- Toast
- Raw(background Task)
- WNS :
One process to register an app for push.
One tile template to push to Windows&phone apps.
Request Channel Uri>Register with your cloud service >Authenticate & Push notification
References : PushTestServer and Sample Code
- Developers Can do:
Tag and group notifications.
Replace a notification with a new one.
Set an expiration on notifications.
Send "Ghost Toast" notifications(only show up in notification center)