Send push information to cloud and eventually send to Windows Phone phone

Source: Internet
Author: User
Keywords Cloud

There are a lot of students complain about MPNs, including service timeout, return various error codes do not know how to deal with and so on. Today I use a little time to explain how to handle and operate our MPNs.

First of all, let's make it clear that Microsoft push Notification Service (MPNs) is an asynchronous push that executes. Today will explain how to use efficient services to send our push information to the cloud and eventually send it to the Windows phone phone.

First how to set the Send timeout

I recommend that you set the timeout time to 15 seconds. For example: When you use the ASP.net for data push, set the WebRequest object to set the timeout time

HttpWebRequest request = (HttpWebRequest) asynchronousresult.asyncstate;
Request. Timeout = 15000;

Second process update of push channel

When your client program discovers the push channel update, the application must update the latest push channel URL to your server. Make sure that your server-side push channel is up to date. Suggest you can use device ID and push channel to match, if find push channel URL update immediately push channel update, server through device ID to judge is, new user registration or already have the user's push channel update.

Windows Phone's official profile provides an example of how to create an application code that accepts push messages, including how to handle, push channel update events. You can refer to how to send and receive a tile notification for Windows Phone to learn how to use the Pushchannel_channeluriupdated method. (another: Push channel length may exceed 1024 characters)

Third use authenticated WEB services to send push notifications for Windows Phone

Using the MPNs authentication side, if your push service has more than 500 push messages in 24 hours for a Windows device, or you want to push messages more securely. Another use of a terminal without MPNs authentication for push, the daily push limit is 500/per device.

How to set the terminal for MPNs authentication.

Set up authenticated WEB services to send push notifications for Windows Phone

No-quota push notifications using a root certificate authority

In addition, if your push service exceeds 500 per day push for each device, one point you will need to consider the user's mobile phone power is in use.

The code returned by MPNs is processed

Typically, a mobile device's network changes, understanding the change-state judgment rules for Windows Phone network connections: Excess flow of device status

You will send the push service to MPNs, and then MPNs will return the device information, you need to observe the device status (Windows Phone's push Notification Service response code), in the process I recommend some practices are as follows:

Response Code Notification status Device connection status Subscription status recommendations OK Queuefull Connect Active recommends that you send a new notification, but you can set a resend interval, and if you receive the same error code, try to extend the retry time: 4–8–16 minutes to 32 minutes. OK queuefull Temp Disconnected Active recommends that you send a new notification, but you can set a resend interval, and if you receive the same error code, try to extend the retry time: 2–4–8 minutes to 24 hours. 404 Not Found The dropped * Any Connection Status expired does not need to attempt to send a message because the push channel no longer exists.

412 Precondition Failed

Dropped disconnected n/a recommends that you try to resend it once per hour, but stop pushing if you return the same error for more than 24 hours. 503 N/A N/a The new notification is recommended, but you can set a resend interval, and if you receive the same error code, try to extend the retry time: 5–10–20–40 seconds and so on to 30 minutes.
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.