wp8.1 Study19: Notice

Source: Internet
Author: User

I. FORM of notification

In the WindowsPhone system, notifications have many forms, such as

(Tile tile has been reviewed in the previous blog post, badge form similar to tile)

1. Toast

It is mainly written using an XML file, with the following XML code:

1 <Toast>2    <Visual>3       <bindingTemplate= "ToastText02">4       <textID= "1">Headline text</text> 5       <textID= "2">Body text</text>6       </binding>7    </Visual>8 </Toast>

Note that you need to apply a toast to your app in the app manifest settings, such as

Ii. Methods of Notification

There are also a number of ways to push notifications

1. Scheduled (as planned)

Set tile,toast template and update time, mainly apply Scheduledtilenotification class and Scheduledtoastnotification class, the demo code is as follows:

var New scheduledtoastnotification (                        xmldoc,                         + timespan.fromdays (1.0)); var toastnotify = toastnotificationmanager.createtoastnotifier (); Toastnotify.addtoschedule ( Scheduletoast);

2, Periodic (using the corresponding server to provide regular updates of data)

The demo code is as follows:

var periodic =new Uri ("http://mysite.com/tileRSS.xml"); Periodic. Startperiodicupdate (Mytilefeed, periodicupdaterecurrence.hour);

The above is the use of their own server address to obtain the tile format file, in addition to the application of the list of settings, such as

3. Local (update locally)

Local updates primarily take advantage of background tasks (Backgroundtask)

Badge update the demo code as follows

New= badgeupdatemanager.createbadgeupdaterforapplication (); update. Update (Newbadge);

4. WNS Server Push

Use Microsoft Notification Server push notifications, this is a push-to-send

Http://pushtestserver.azurewebsites.net/wns/demo Example

wp8.1 Study19: Notice

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.