Push Notification (push notification) overview, pushing Toast notification
Introduced
Special push notification for Windows Phone 7.5 (SDK 7.1)
Overview
Push Toast Notification
Example
1. Overview
Summary.xaml
<phone:PhoneApplicationPage
x:Class="Demo.PushNotification.Summary"
Xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
Xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
Xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
Mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
Shell: SystemTray.IsVisible="True">
<StackPanel Orientation="Vertical">
<TextBlock Text="Push Notification Model" />
<Image Source="/PushNotification/Summary.jpg" />
<TextBlock TextWrapping="Wrap" Margin="0 15 0 0">
<Run>Overview of Push Notifications</Run>
<LineBreak />
<LineBreak />
<Run>1, there can only be one push notification channel per program, and each device can only have a maximum of 30 push notification channels</Run>
<LineBreak />
<Run>2, Http Header for push notifications up to 1 KB, maximum content 3 KB</Run>
<LineBreak />
<Run>3, authenticate the web service (ie https protocol), reference: http://msdn.microsoft.com/en-us/library/ff941099(v=vs.92)</Run>
<LineBreak />
<Run> 4. For authenticated web services, MPNS can support callback of the specified authenticated web service when the device goes to active or inactive, refer to: http://msdn.microsoft.com/en- Us/library/ff402554(v=vs.92)</Run>
</TextBlock>
</StackPanel>
<!-- The characters to be encoded in the push message
< - <
> - >
& - &
' - '
" - " --> </phone:PhoneApplicationPage>
2, push to send Toast notice
Client
Pushtoast.xaml
<phone:PhoneApplicationPage
x:Class="Demo.PushNotification.PushToast"
Xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
Xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
Xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
Mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
Shell: SystemTray.IsVisible="True">
<StackPanel Orientation="Vertical">
<Button Name="btnRegister" Content="Get Channel Uri" Click="btnRegister_Click" />
<TextBox Name="txtUrl" />
<TextBlock Name="lblMsg" TextWrapping="Wrap" />
</StackPanel>
</phone:PhoneApplicationPage>