Question

On my WP8 app, I followed instructions from here to register on push notifications service MPNS.:

HttpNotificationChannel pushChannel;

// The name of our push channel = the CN from certificate
string channelName = "CN-from-cert";

However, channel URI returned from the MPNS is always http:// and it seems like it's not using this secured connection. So, my question is:

  1. How can I verify if my channel is using no-quote (secure) connection

  2. What is needed on the client side (WP8 app)?

  3. What is needed on the server side (sending push notifications)?

Many thanks.

Était-ce utile?

La solution

I think you need to set ServiceName property (not channelName) to your service's domain name exactly as it appears on CN property in the server certificate that you will use. P.e., if your certificate's CN=www.mydomain.com, you must set Channel.ServiceName="www.mydomain.com". Channel name my be anyone that you like. This is at client side.

At server side you need to upload your cert file to developer.windowsphone.com dashboard and to your server too (with the private key).

You can check if MPNS recognize your secure channel by checking if channel URI generated starts with https:// instead http://. This not ensure that your server can send trusted notifications since it depends on if you have the same certificate in your server and specify it correctly in all petitions, but tells you that client side is ok.

You have detailed information about how to configure your server here: http://msdn.microsoft.com/en-US/library/windowsphone/develop/ff941099%28v=vs.105%29.aspx

Best practices to implement a push notification system (including authenticated servers): http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/10/22/recommended-practices-for-using-microsoft-push-notification-service-mpns.aspx

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top