Archive for June, 2013

Like the push notification on Windows Phone 7, there is also another type of notifications that you can do using the Service Bus. There are several ways to do so, for nowadays, there are a new way that facilitate much more the development and the subscription of the devices to the Service Bus. This kind of Service Bus is called the Service Bus Notification Hub, like the Service Bus Relay Messaging and the Service Bus Brokered Messaging, there are some steps that you should do to create the required Service Bus Notification Hub. This feature is still in Preview.

Here are the steps:

You have to download special references for the development for the Push Notification hub. After creating your project on Visual Studio, go to tools -> Library Package Manager -> Package Manager Console and enter the following command:

Install-Package ServiceBus.Preview

Going to the portal:

First of all, go to you Windows Azure Portal and quick Create a notification hub as shown below

After creating the service bus, there are several few things that must be done to register in the service bus.

Here they are in brief I will explain each one of them later on.

  1. Download the required ServiceBus.Preview.dll from the NuGet, previously explained.
  2. Create a Windows Store application using Visual Studio
  3. Get the Package SID & Client Secret from after registering the application in the store and paste it in the Notification Hub Configuration
  4. Associate the application created on Visual Studio with the one created on the store.
  5. Get the Connection information from the Notification hub.
  6. Enable the Toast Notification on the Windows 8 application.
  7. Get the Microsoft.WindowsAzure.Messaging.Managed.dll from the following link.
  8. Insert the notification hub as an attribute.

I will skip the second step which is so easy creating Windows Store application.

The third step go to create an account if you don’t have. After that submit your app, reserve your application name, then click on the third tile named Services.

Under the Services go to Authenticating your service

Copy the following package SID and the Client secret:

Now for the 4th step, in your created Windows Store application on Visual Studio right click on the project created and go to store and then click on associate App with the store. It will require that you sign in with the windows live account which you create the development account with. After that you will have to associate your application with the registered one on the store.

For the 5th step, let’s get back to the Azure account, in the Notification hub, we can get the connection information from the connection information under the service bus in the notification hub. Like the following picture:

The 6th step, is in your Windows 8 application to enable the toast push notification which is a very easy and small step. Just go to your Package.appmanifest and change the toast capable to “Yes”

The rest is for the development in the Windows Store, first thing we certainly have to do is to insert the libraries. So in the App.xaml enter the following libraries:






the next step is to create an instance of NotificationHub object:


And in the constructor of the app.xaml, initialize the instance of the object. Just don’t forget to change the DefaultListenSharedAccessSignature by its true value from the connection information retrieved from the Azure account in a previous step.

NotificationHub(“myhub”, “DefaultListenSharedAccessSignature”);

Initialize the notification by registering the channel by its Uri.






After that call the initialization function on the launch of the application or OnActivated.


The previous part was for receiving the notification for sending the notification the following code will solve the issue. Don’t forget to enter the necessary libraries.

You can enter the following code in the desired function:

NotificationHubClient.CreateClientFromConnectionString(“connectionstring”, “myhub”);

“<toast> <visual> <binding template=\”ToastText01\”> <text id=\”1\”>Hello! </text> </binding> </visual> </toast>”;


After that you will be able to develop the application as required, in the following link, you can find all the related development issues for Windows Store apps in this link, this one for the Android and the last one is for the iOS.

Now for further development I have done a simple Windows 8 application that sends and receive push notifications using Service Bus Notification Hub, you can download the source code from here.

The Notification hub for now supports only Microsoft Platform, Apple iOS and Android. Here is some video reference on Channel 9 that I hope it can help you during your development.

Here is one of my sources which explains everything in details about the Push Notification Using Service Bus.

For those who work with Microsoft Cloud Computing Platform, Windows Azure Mobile Services or Node JS in general, if you went through the development using JavaScript you might have faced this problem before: “Missing ‘new’ prefix when invoking a constructor”.

This Problem appears especially when you create a function and when you call this function in any other one, this problem appears. Actually you haven’t done anything wrong, this appears when you create the functions with Capital letters at the beginning like the following example:








If you create the function with a Capital Letter the JavaScript consider it as a constructor not like a normal function, that’s why you might face the following error.

You can avoid this by simply creating the functions without Capital letters in its beginning.

For the Microsoft Cloud Computing platform Windows Azure, a new Version for the .Net has been released on April 2013. A new updates were certainly added, it also made some changes in the development syntax.

Now if you do have any version of Windows Azure SDK from 1.7 to 2.0 it will run side by side with no problem. During the development if an application if you face an error like the following:

“The system is missing a prerequisite to execute the service.”

You have to know that the application that you are working on is built using a different version not supported by the Side-by-Side Cloud Service Debugging. To solve this you will have to uninstall the version of .NET SDK you are working with and reinstall the compatible one so you can continue your development.

Now moving to the new added features, as some of you may have worked with the Windows Azure Websites, you can also find it as added as a new features in visual studio for management, diagnostics and deployment. You can find all the websites added to the server explorer in Visual studio.

Another feature added to the Cloud Service is the A6 and the A7 virtual machine size. These powerful processing power and large RAM build and even host bigger applications on Windows Azure if using the Virtual Machines
IaaS. This can be very helpful in hosting Microsoft dynamics or SharePoint on it for better usage specially that each of them requires a large amount of memory minimum of 16 GB to run.

Still for the Cloud Service, the Guest OS that used to be installed in your VM to run your application can be upgraded from the latest version 1 or 2 to the latest one which is the version 3.

Now let’s get into some development features, starting with the Storage Client. First of all the library name has been changed from the Microsoft.WindowsAzure.StorageClient to Microsoft.WindowsAzure.Storage. For more information about the technical issues I do recommend you to visit the following link.