locked
Push Notification channel in Windows Phone 8.1 Silverlight RRS feed

  • Question

  • Hi Guys

    Running Windows 8.1, Visual Studio 2013 with Update 5

    so I'm trying to set up a basic push notification channel in a Windows Phone 8.1 Silverlight app.

     pushChannel = HttpNotificationChannel.Find(channelName);
    
                // If the channel was not found, then create a new connection to the push service.
                if (pushChannel == null)
                {
                    pushChannel = new HttpNotificationChannel(channelName);
    
                    // Register for all the events before attempting to open the channel.
                    pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
                    pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
                    pushChannel.HttpNotificationReceived += new EventHandler<HttpNotificationEventArgs>(PushChannel_HttpNotificationReceived);
    
                    pushChannel.Open();
    
                }
                else
                {
                    // The channel was already open, so just register for all the events.
                    pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated);
                    pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
                    pushChannel.HttpNotificationReceived += new EventHandler<HttpNotificationEventArgs>(PushChannel_HttpNotificationReceived);
    
                    // Display the URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
                    System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString());
                    MessageBox.Show(String.Format("Channel Uri is {0}",
                        pushChannel.ChannelUri.ToString()));
    
                }

    Nothing too exciting there...however when i run the app an exception is thrown at 

     pushChannel.Open();

    

    So the question is - where do i define ID_CAP_PUSH_NOTIFICATION when the project does not have  a WMAppManifest.xml file.


    cheers 

    Bryce

    the 


    Tuesday, August 4, 2015 12:29 AM

Answers

  • WMAppManifest.xml is found in the Properties folder of your application. Please let us know if that is not true for your project.


    Scott Seely

    • Marked as answer by Bryce Burrows Tuesday, August 4, 2015 8:34 PM
    Tuesday, August 4, 2015 5:08 PM
  • oh for CRYING out loud!!!!

    how the bloody hell did i miss that.

    goddamit!!!

    (thanks)

    Bryce (feeling once again like an idiot)

    • Marked as answer by Bryce Burrows Tuesday, August 4, 2015 8:34 PM
    Tuesday, August 4, 2015 8:34 PM

All replies

  • WMAppManifest.xml is found in the Properties folder of your application. Please let us know if that is not true for your project.


    Scott Seely

    • Marked as answer by Bryce Burrows Tuesday, August 4, 2015 8:34 PM
    Tuesday, August 4, 2015 5:08 PM
  • oh for CRYING out loud!!!!

    how the bloody hell did i miss that.

    goddamit!!!

    (thanks)

    Bryce (feeling once again like an idiot)

    • Marked as answer by Bryce Burrows Tuesday, August 4, 2015 8:34 PM
    Tuesday, August 4, 2015 8:34 PM
  • Not a problem. I'm just happy we could help you out here. If you missed this, it's likely someone else will too and this answer will assist them when they 'Bing' the same question:)

    Scott Seely

    Tuesday, August 4, 2015 9:53 PM