iamnicoj
iamnicoj

Reputation: 497

NotificationHubNotFoundException Windows Phone 8

While I´ve been trying to make the basic notification hub tutorial work on my Windows Phone solution with the following code

var channel = HttpNotificationChannel.Find("MyPushChannel3");
            if (channel == null)
            {
                channel = new HttpNotificationChannel("MyPushChannel3");
                channel.Open();
                channel.BindToShellToast();
            }

            channel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(async (o, args) =>
            {
                var hub = new NotificationHub("http://messaging-ns.servicebus.windows.net/messagingt", "---MY CONECTION STRING---");
                await hub.RegisterNativeAsync(args.ChannelUri.ToString());
            });

I get a NotificationHubNotFoundException in the await line with the following message

HTTP request failed.

HTTP Details: Status: 404 Reason: Not Found Full content: 404No service is hosted at the specified address..TrackingId:2e4b1100-18de-4b24-bbec-68516ddc3b60_G4,TimeStamp:2/2/2014 1:30:23 AM

I tried a number of options for the first parameter of the NotificationHub constructor called "notificationHubPath" with no luck to get my app registered. Anyone has faced this error in the past. Unfortunately there are not enough documentation in how does this constructor works in MDSN.

Thanks

Upvotes: 0

Views: 309

Answers (2)

saramgsilva
saramgsilva

Reputation: 762

I had the same issue, and after close/open VS2013, restart PC and change Wifi/3g connection it worked again like before... strange, i suppose that was a internet connection issue.

you can use fiddler to show more information, i forgot in my case...

Upvotes: 0

anderZubi
anderZubi

Reputation: 6424

When creating the NotificationHub type object, try by passing just the hub name with the connection string, not the whole address:

var hub = new NotificationHub("messagingt", "---CONECTION STRING---");

Upvotes: 1

Related Questions