Skip to content

Commit 61faec6

Browse files
committed
bug fix to windows push
1 parent d9c8b12 commit 61faec6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

articles/app-service-mobile-dotnet-backend-windows-universal-get-started-push-preview.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ Now that push notifications are enabled in the app, you must update your app bac
9999

100100
1. In Visual Studio, right-click the solution, then click **Manage NuGet Packages**.
101101

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.
103103

104104
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:
105105

106106
using System;
107107
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;
109111

110112
4. Update the `PostTodoItem` method definition with the following code:
111113

@@ -124,11 +126,11 @@ Now that push notifications are enabled in the app, you must update your app bac
124126

125127
try
126128
{
127-
var result = await Hub.Push.SendWindowsNativeNotificationAsync(windowsToastPayload);
129+
var result = await Hub.SendWindowsNativeNotificationAsync(windowsToastPayload);
128130
}
129131
catch (System.Exception ex)
130132
{
131-
throw;
133+
throw ex;
132134
}
133135
return CreatedAtRoute("Tables", new { id = current.Id }, current);
134136
}
@@ -152,7 +154,8 @@ Now that push notifications are enabled in the app, you must update your app bac
152154

153155
3. Open the App.xaml.cs project file and add the following `using` statements:
154156

155-
using Microsoft.AzureAppServiceMobile;
157+
using Windows.Networking.PushNotifications;
158+
using Microsoft.WindowsAzure.MobileServices;
156159

157160
In a universal project, this file is located in the `<project_name>.Shared` folder.
158161

0 commit comments

Comments
 (0)