Types of Windows Phone push notifications

Source: Internet
Author: User
Tags truncated

The following describes key information about successful push notifications.

Important:

We recommend that you set up an authenticated Web service to send notifications to the Microsoft push notification service, because communication over the HTTPS interface is more secure, authenticated Web services have no limits on the number of push notifications they can send each day. On the other hand, the unauthenticated web service limits the rate of 500 push notifications per day for each subscription. For more information, seeSet verified web services to send push notifications for Windows Phone.

  • There is a limit, that is, each applicationProgramOnly one push notification channel is allowed. This unique channel applies to all notification types available for the application. If the application exceeds this limitInvalidoperationexception (pushnotificationchannelquotaexceeded)Exception. For more information, seeReceive push notifications from Windows Phone.

  • There is also a limit that each device can have only 30 push notification channels. If the application attempts to register a push notification channel but has reached the limit of 30 push notification channels per deviceInvalidoperationexception (pushnotificationchannelquotaexceeded)Exception. For more information, seeReceive push notifications from Windows Phone.

  • If you bind the push notification channel to the toast notification in the application,Other requirements for specific application typesIn"Push notification application"Section andApplication PolicyThe requirements listed in section 2.9.

  • Push notifications should not contain personal ID information.

  • One challenge for developing apps that use push notifications is that simulators are not restricted by actual conditions and always have reliable connections. A notification that works reliably in the simulator may not work reliably on the actual device, because the connection strength may change or the network operator configuration is incompatible. If the connection is not in a reliable state, developers may wish to limit the number of notifications until they are in a normal state. Developers should test their applications on as many devices and mobile carriers as possible. By programming the real connection status in a defensive manner, developers can properly downgrade functions in their applications.

  • The maximum size of the notification is 1 kb (for the header) and 3 kb (for the load ). Notifications that exceed these limits will be discarded and the status will beWebexceptionstatus. protocolerrorOfWebexception.

  • The push client cannot work through the socks proxy. If the device transitions to the network that requires a SOCKS proxy, the device cannot use the PUSH Service. If you are testing on a simulator, you must configure the socks proxy. For more information, seeProxy Support for Windows Phone Simulator.

When sending information to an application, the Web service can use three types of push notifications: Toast, tile, and raw notifications.

Toast notification

Toast notificationDisplays at the top of the screen to notify users of an event, such as news or weather alerts. The toast will be displayed for about 10 seconds unless you click to the right to close the notification. If you click toast, the application that sends the toast notification is started.

The toast notification elements are as follows:

    • Title. The ITALIC string that is displayed next to the application icon. In the XML architecture, this string is definedText1Attribute.

    • Content. Next"Title"A non-italic string. In the XML architecture, this string is definedText2Attribute.

    • Parameters. If you click toast, the parameter value is passed to your application without being displayed. This parameter indicates the page to which the application should be started. This parameter also contains the name-Value Pair passed to the application. In the XML architecture, this string is definedParamAttribute.

Important:

Used to setParameterThe toast notification of properties can only be sent to devices running Windows Phone OS 7.1 or later. Will haveParameterMessages sent to the Windows Phone OS 7.0 device will causePusherrortypepayloadformatinvalidError, and the channel is closed.

The number of texts that can be displayed depends on the Characters Used in the toast message and"Title"(BOLD) and"Content"(Not in bold. If only one"Title"It can be approximately 40 characters long and the subsequent characters will be truncated. If only"Content", It can display about 47 characters. If a toast"Title"And"Content"The average split between them can be approximately 41 characters long. Any text that cannot be placed on toast will be truncated.

Windows Phone"Title"And"Content"In the left-side navigation pane. Although you can define icons associated with your application, different icons cannot be passed for a toast notification.

Tile notification

Tile notificationIt can be used to update the tile on the Start Screen. For more information about tile attributes and how to update tile attributes, seeWindows Phone tile Overview. You can use the tile notification to update the following attributes on the front of the tile.

    • Title. A string that indicates the application title.TitleIt must be applicable to a single line of text and should not be wider than the actual tile width. The title can contain about 15 characters, and the remaining parts will be truncated.

    • Backgroundimage. The image displayed on the front of the tile. We recommend that you always have a background image on the front of the tile.

    • Count (also known as badges). The integer from 1 to 99. If the "count" value is not set or the value is set to 0, the circular image and value are not displayed on the tile.

You can use the tile notification to update the following attributes on the back of the tile.

    • Backtitle. The string displayed at the bottom of the tile.BacktitleIt must be applicable to a single line of text and should not be wider than the actual tile width. The title can contain about 15 characters, and the remaining parts will be truncated.

    • Backbackgroundimage. The image displayed on the back of the tile.

    • Backcontent. The string that is displayed in the center of the back of the tile. The tile can contain about 40 characters, and the excess part will be truncated.

Important:

Used to setBacktitle,BackbackgroundimageOrBackcontentAttribute tile notification or by setting the tile in the loadIDYou can only send notifications to devices running Windows Phone OS 7.1 or later. Sending notifications with these values to a Windows Phone OS 7.0 device causesPusherrortypepayloadformatinvalidError, and the channel is closed.

Some images are usedBackgroundimageAndBackbackgroundimageAdditional description of attributes:

    1. The tile image can be a. jpg or. PNG file.

    2. Due to network variability and performance, consider using local resources for tile images.

    3. Using a. PNG that is transparent to the image will allow the user to display the theme color through it.

    4. The tile size is 173x173 pixels. If the image you provide has different sizes, it will be stretched to fit 173x173 pixels.

    5. You can use local or remote resources as images. If a local resource is used, the resource must be installed as part of the xap package.

    6. If you disable the tile notification, the tile should contain general information. Do not include any outdated data, such as expired weather forecasts or traffic reports.

    7. Not SupportedHTTPSAs a remote image.

    8. The remote image size is limited to 80 kb or less. If it is larger than 80 KB, it will not be downloaded.

    9. The remote image must be downloaded within 30 seconds or less. Otherwise, the image will not be downloaded.

    10. IfBackgroundimageOrBackbackgroundimageIf the image cannot be loaded for any reason, no other attributes set in the update will be changed.

Raw notification

AvailableRaw notificationSend information to your application. If your application is not running, the raw notification is discarded on the Microsoft push notification service and is not sent to the device.

 

Http://msdn.microsoft.com/zh-cn/library/ff402558 (V = vs.92)

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.