Windows Phone 7 Push Notifications Not Showing Up On My Phone

后端 未结 2 1518
野性不改
野性不改 2021-02-10 02:34

UPDATE: The plot thickens. I changed my channel name and it is suddenly working (which means it wasn\'t a problem with my push service, since I\'m getting the same HTTP response

相关标签:
2条回答
  • 2021-02-10 03:20

    To me, however, this is not a solution. How will I be able to test this and KNOW my users are getting their push notifications if I'm getting the same response when it's not working as I do when it is?

    The answer is, you can't. It's a limitation of how WP7 handles notifications.

    For structured notifications like Tile and Toast, if you get the Connected/Active/Received/200 response, then you can know that MPNS accepted your notification request. However, this does not mean that you have sent a valid XML payload.

    The component that handles parsing XML is the Push Client, the process running on the phone that accepts push notifications and deals them out to appropriate applications, displays the toast, etc.

    If you have sent invalid XML, there is absolutely no indication that you've done so. At most, if you try to send the notification again to that same push channel URI, you'll get a 404 in response. Apparently getting an invalid XML payload for a specific application makes that application's push channel close, requiring you to go through the whole procedure again.

    I've discovered this while debugging with our server team, and through trying to get the phone to display an alternate live tile. The only advice I can offer you is to quadruple-check your XML.

    You will get errors in your error event handler for your push notification channel for Toast notifications that have invalid XML, since you are able to send/receive toast notifications while the application is active.


    If anyone from Microsoft is reading this, PLEASE provide more thorough documentation on possible error states in the push notification system. We also need an event handler for Tile notifications, or at least allow us to receive tile notifications while the app is in the foreground and fire the notification channel error event so that we can be aware that our XML payload is invalid.

    Especially if your web service isn't built with WCF, .NET, Azure, and whatever, working with Push Notifications on WP7 is like wandering blind.

    Documentation for an exception message reading "InvalidOperationException(Failed to open channel)" should not read: "This exception is raised when the notification channel failed to open. Try opening the notification channel again." (reference)

    0 讨论(0)
  • 2021-02-10 03:39

    are you getting the URL from each device? you need to get a URL from the push notification sevice for each device everytime your device connects,

    when it does you need to find a way of retrieving the url from each client,

    once you do that and your still not receiving push notifications then I would write to microsoft to see if they can see anything to do with the push notifications

    0 讨论(0)
提交回复
热议问题