Introduction
This writing is a continuation of Notification Hub on Microsoft Azure in Universal Windows Platform Apps to send push notifications.
Technical Requirements
- Microsoft Azure account – Click here to get an Azure account.
- Visual Studio 2015 installed on your laptop
- Windows Store Account.
Initially, to send push notification to Universal Windows Platform apps, you must connect your app to the Windows Store portal. So, let’s start with registering the app on Windows Store.
Registering the App
Step 1
Log into Windows Dev Center and click on Sign in.
Step 2
Click on "Dashboard".
Step 3
Click on "Create a new app".
Step 4
Reserve an app name here which should be unique. You can also check the availability over here.
This tick mark shows that the app name is available and you can reserve it.
Step 5
Click on "Reserve product name".
Now, the app has been reserved for us in Windows Dev Center.
Step 6
Run Visual Studio 2015 in your laptop. Click on New Project >> Visual C#, expand Visual C# >> Windows >> Universal and go for Blank App (Universal Windows). Now, name your app and click on "OK" to create it.
Here is the project you have created.
Step 7
Right click on the solution name in the Solution Explorer, go to Store, and click on "Associate App with the Store...".
Click on "Next" to associate your app with the Store.
Step 8
Sign in with your Store account in the below window.
Step 9
You will be receiving an OTP to access your Dev Center account from Visual Studio 2015.
Step 10
Select your app name that your reserved previously and click on Next. Here, I will be selecting “najunotifyuwp”.
Step 11
Now, you will be displayed a local manifest. Just verify it and click on "Associate".
Your Solution Explorer will be updated with the associated app, as shown below.
Step 12
Move back to the Windows Dev Center, open the App that you reserved before, and click on "Push Notifications" under Services.
Step 13
Click on "Live Services Site" now.
Now, make a note of the Application Registration Portal with the application secret password and package security identifier (SID).
Step 14
Once the Application Secret Password is copied, move to the Azure Portal and create a Notification Hub on it.
Go for "Access Policies" in the Notification Hub under Manage. Make a note of the connections strings that are available here.
Step 15
Go to Notification Services under Manage, select "Windows (WNS)" under "General" and enter the Package SID with Security Key from Windows Dev Center where you made a note previously.
Step 16
Click on "Save' after the Package SID and Security Key are added.
Click on "Save" to save the configured app with the Notification Hub.
Keynotes in short
- Registering the app in Windows Dev Center.
- Universal Windows Platform app development in Visual Studio 2015.
- Configuring the Notification Hub with Package SID and Security Key.
Follow my posts to send notifications from UWP by adding NuGet packages.