Toast notifications for background agents for Windows Phone 8

Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 | Windows Phone OS 7.1

A toast notification is displayed at the top of the screen to notify users of an event. When a background agent is running or has completed some work, you can use the ShellToast APIs to notify the user. While the Show() method can be called from any application, a toast will not be displayed if the current foreground application is the caller of the Show method.

A toast is made up of the following properties:

  • Title - A boldface string that displays immediately after the application icon.

  • Content - A non-boldface string that displays immediately after the Title.

  • NavigationUri - The URI to navigate to if the user taps the toast message.

AP_Toast_ToastElements

The amount of text that can be displayed depends on the characters used in the toast message and the length of the Title, which is bolded, and Content, which is not bolded. If only a Title is set, then approximately 40 characters can be displayed before being truncated. If only the Content is set, then approximately 47 characters can be displayed. If a toast is split evenly between a Title and the Content, then approximately 41 characters can be displayed. Any text that does not fit on the toast will be truncated. Windows Phone displays a small version of your application icon to the left of Title and Content. While you can define what icon is associated with your application, it is not possible to pass a different icon for a toast notification.

Show:
© 2015 Microsoft