You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service-mobile-dotnet-backend-windows-universal-get-started-push-preview.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,13 +99,15 @@ Now that push notifications are enabled in the app, you must update your app bac
99
99
100
100
1. In Visual Studio, right-click the solution, then click **Manage NuGet Packages**.
101
101
102
-
2. Search for **WindowsAzure.ServiceBus** and click **Install** for all projects in the solution.
102
+
2. Search for **Microsoft.Azure.NotificationHubs** and click **Install** for all projects in the solution.
103
103
104
104
3. In Visual Studio Solution Explorer, expand the **Controllers** folder in the mobile backend project. Open TodoItemController.cs. At the top of the file, add the following `using` statements:
105
105
106
106
using System;
107
107
using System.Collections.Generic;
108
-
using Microsoft.ServiceBus.Notifications;
108
+
using Microsoft.Azure.Mobile.Server;
109
+
using Microsoft.Azure.Mobile.Server.Config;
110
+
using Microsoft.Azure.NotificationHubs;
109
111
110
112
4. Update the `PostTodoItem` method definition with the following code:
111
113
@@ -124,11 +126,11 @@ Now that push notifications are enabled in the app, you must update your app bac
124
126
125
127
try
126
128
{
127
-
var result = await Hub.Push.SendWindowsNativeNotificationAsync(windowsToastPayload);
129
+
var result = await Hub.SendWindowsNativeNotificationAsync(windowsToastPayload);
128
130
}
129
131
catch (System.Exception ex)
130
132
{
131
-
throw;
133
+
throw ex;
132
134
}
133
135
return CreatedAtRoute("Tables", new { id = current.Id }, current);
134
136
}
@@ -152,7 +154,8 @@ Now that push notifications are enabled in the app, you must update your app bac
152
154
153
155
3. Open the App.xaml.cs project file and add the following `using` statements:
154
156
155
-
using Microsoft.AzureAppServiceMobile;
157
+
using Windows.Networking.PushNotifications;
158
+
using Microsoft.WindowsAzure.MobileServices;
156
159
157
160
In a universal project, this file is located in the `<project_name>.Shared` folder.
0 commit comments