Skip to content

Commit bd62907

Browse files
committed
Add SDK info
1 parent 5243d71 commit bd62907

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

articles/notification-hubs/android-sdk.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: Send push notifications to Android using Azure Notification Hubs and Fire
33
description: In this tutorial, you learn how to use Azure Notification Hubs and Google Firebase Cloud Messaging to send push notifications to Android devices (version 1.0.0-preview1).
44
author: sethmanheim
55
ms.author: sethm
6-
ms.date: 06/30/2023
6+
ms.date: 03/14/2024
77
ms.topic: tutorial
88
ms.service: notification-hubs
9-
ms.reviewer: thsomasu
10-
ms.lastreviewed: 05/27/2020
9+
ms.reviewer: heathertian
10+
ms.lastreviewed: 03/14/2024
1111
ms.custom: devx-track-csharp
1212
---
1313

@@ -32,6 +32,9 @@ This tutorial covers the following steps:
3232

3333
To complete this tutorial, you must have an active Azure account. If you don't have an account, you can create a free trial account in just a couple of minutes. For details, see [Azure Free Trial](https://azure.microsoft.com/free/).
3434

35+
> [!NOTE]
36+
> Google/Firebase APIs are not supported in Azure China regions.
37+
3538
You also need the following items:
3639

3740
- The latest version of [Android Studio](https://go.microsoft.com/fwlink/?LinkId=389797) is recommended.

articles/notification-hubs/browser-push.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ manager: femila
77
ms.service: notification-hubs
88
ms.tgt_pltfrm: mobile-multiple
99
ms.topic: article
10-
ms.date: 12/06/2023
10+
ms.date: 03/14/2024
1111
ms.author: sethm
1212
ms.reviewer: heathertian
13-
ms.lastreviewed: 12/06/2023
13+
ms.lastreviewed: 03/14/2024
1414
---
1515

1616
# Web push notifications with Azure Notification Hubs (preview)
@@ -25,6 +25,7 @@ At a high level, the process is:
2525
1. [Set credentials](#set-credentials):
2626
- [In the Azure portal](#set-credentials-in-azure-portal)
2727
- [Using the REST API](#set-credentials-using-rest-api)
28+
- [Using the Azure SDKs](#set-credentials-using-azure-sdks)
2829

2930
2. [Create registrations and installations](#create-registrations-and-installations).
3031

@@ -107,6 +108,27 @@ Enter the credentials in this format, providing the subscription ID, resource gr
107108
https://management.azure.com/subscriptions/{subcription}/resourceGroups/{resource-group}/providers/Microsoft.NotificationHubs/namespaces/{namespace}/notificationHubs/{hub}api-version=2016-03-01
108109
```
109110

111+
### Set credentials using Azure SDKs
112+
113+
You can set the credentials for Browser Push using the Azure SDKs. Here's an example using the .NET SDK:
114+
115+
```csharp
116+
var browserCreds = new BrowserCredential
117+
{
118+
Subject = "<subject>",
119+
VapidPublicKey = "<vapid public key>",
120+
VapidPrivateKey = "<vapid private key>",
121+
}
122+
123+
and:
124+
125+
```csharp
126+
await nhManagementClient.NotificationHubs.CreateOrUpdateAsync(config.ResourceGroupName, config.NamespaceName, config.HubName, new NotificationHubCreateOrUpdateParameters(config.Location)
127+
{
128+
BrowserCredential = browserCreds
129+
});
130+
```
131+
110132
## Create registrations and installations
111133

112134
Bulk sends require registrations or installations. You can also use the registrations and installations in debug sends.
@@ -149,21 +171,19 @@ The following examples show the registration request body for a native registrat
149171
}
150172
```
151173

152-
### .NET SDK
153-
154-
Create native registrations:
174+
### Create native registrations (SDK)
155175

156176
```csharp
157177
await notificationHubClient.CreateBrowserNativeRegistrationAsync(subscriptionInfo, tagSet);
158178
```
159179

160-
Create template registrations:
180+
### Create template registrations (SDK)
161181

162182
```csharp
163183
await notificationHubClient.CreateBrowserTemplateRegistrationAsync(subscriptionInfo, template, tagSet);
164184
```
165185

166-
Create browser installations:
186+
### Create browser installations (SDK)
167187

168188
```csharp
169189
var browserPushSubscription = new BrowserPushSubscription

0 commit comments

Comments
 (0)