Different Windows Phone (9)

Source: Internet
Author: User
Tags web services xmlns


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    
        < - &lt;
        > - &gt;
        & - &amp;
        ' - &apos;
        " - &quot; --> </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> 




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.