在你的应用(实际上是应用背后的服务)成功发布推送消息到MPNS后,MPNS将给予该服务请求一个响应码。

这些响应码的详细说明请参见:http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff941100(v=vs.105).aspx

应用服务可以根据这些返回码的情况分别处理。

我们这里给出一些典型的返回码的处理建议:

Response code

Notification status

Device connection status

Subscription status

Recommendations

200 OK

QueueFull

Connect

Active

Your service may resend a notification. If it does, it should have an exponential back-off/retry logic on the order of minutes.

Resend after 2 minutes; if the same message comes back, resend after 4 minutes, 8 minutes, 16 minutes, etc… up to 32 minutes.

200 OK

QueueFull

Temp Disconnected

Active

Your service may resend a notification. If it does, it should have an exponential back-off/retry logic.

Resend after 1 minute; if the same message appears, resend after 2 minutes, 4 minutes, 8 minutes, and so on, up to 24 hours.

404 Not Found

Dropped

* Any Connection Status

Expired

Do not send any additional notifications to this URI because it no longer exists.

412 Precondition Failed

Dropped

Disconnected

N/A

Your service may resend a notification. If it does, it should retry, at most, once an hour over a 24-hour period. If it still fails after 24 hours, your service should no longer send retries for that notification.

503

N/A

N/A

N/A

Your service may resend a notification. If it does, it should have an exponential back-off/retry logic.

Resend after 5 seconds, if the same message comes back, resend after 10 seconds, 20 seconds, 40 seconds, and so on, up to 30 minutes.