Microsoft Azure - Send Push Notifications With UWP Apps - Part One

In this article you will learn to send push notifications in Microsoft Azure with UWP apps

Introduction

This writing is a continuation of Notification Hub on Microsoft Azure in Universal Windows Platform Apps to send push notifications.

Technical Requirements

  1. Microsoft Azure account – Click here to get an Azure account.
  2. Visual Studio 2015 installed on your laptop
  3. 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.

Windows Store Portal

Step 2

Click on "Dashboard".

Windows Store Portal

Step 3

Click on "Create a new app".

Windows Store Portal

Step 4

Reserve an app name here which should be unique. You can also check the availability over here.

Windows Store Portal

This tick mark shows that the app name is available and you can reserve it.

Windows Store Portal

Step 5

Click on "Reserve product name".

Windows Store Portal

Now, the app has been reserved for us in Windows Dev Center.

Windows Store Portal

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.

Windows Store Portal

Here is the project you have created.

Windows Store Portal

Step 7

Right click on the solution name in the Solution Explorer, go to Store, and click on "Associate App with the Store...".

Windows Store Portal

Click on "Next" to associate your app with the Store.

Windows Store Portal

Step 8

Sign in with your Store account in the below window.

Windows Store Portal

Step 9

You will be receiving an OTP to access your Dev Center account from Visual Studio 2015.

Windows Store Portal

Step 10

Select your app name that your reserved previously and click on Next. Here, I will be selecting “najunotifyuwp”.

Windows Store Portal

Step 11

Now, you will be displayed a local manifest. Just verify it and click on "Associate".

Windows Store Portal

Your Solution Explorer will be updated with the associated app, as shown below.

Windows Store Portal

Step 12

Move back to the Windows Dev Center, open the App that you reserved before, and click on "Push Notifications" under Services.

Windows Store Portal

Step 13

Click on "Live Services Site" now.

Windows Store Portal

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.

Windows Store Portal

Windows Store Portal

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.

Windows Store Portal

Step 16

Click on "Save' after the Package SID and Security Key are added.

Windows Store Portal

Click on "Save" to save the configured app with the Notification Hub.

Keynotes in short

  1. Registering the app in Windows Dev Center.
  2. Universal Windows Platform app development in Visual Studio 2015.
  3. Configuring the Notification Hub with Package SID and Security Key.

Follow my posts to send notifications from UWP by adding NuGet packages.