Skip to content

Commit 7770a27

Browse files
authored
Merge pull request #218276 from sethmanheim/server-key-ext
Fixes to external submission #101319
2 parents e29d3b8 + a419a0d commit 7770a27

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

articles/notification-hubs/android-sdk.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Send push notifications to Android using Azure Notification Hubs and Fire
44
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).
55
author: sethmanheim
66
ms.author: sethm
7-
ms.date: 5/28/2020
7+
ms.date: 11/14/2022
88
ms.topic: tutorial
99
ms.service: notification-hubs
1010
ms.reviewer: thsomasu
@@ -82,6 +82,16 @@ The first step is to create a project in Android Studio:
8282

8383
8. Copy and save the **Server key** for later use. You use this value to configure your hub.
8484

85+
9. If you do not see a **Server key** on the **Firebase Cloud Messaging** tab, follow these steps:
86+
1. Select the three-dots menu of the **Cloud Messaging API (Legacy) Disabled** heading.
87+
1. Follow the link to **Manage API in Google Cloud Console**.
88+
1. In the Google Cloud Console, select the button to enable the Google Cloud Messaging API.
89+
1. Wait a few minutes.
90+
1. Go back to your Firebase console project **Cloud Messaging** tab, and refresh the page.
91+
1. See that the Cloud Messaging API header has changed to **Cloud Messaging API (Legacy) Enabled** and now shows a server key.
92+
93+
:::image type="content" source="media/android-sdk/notification-hubs-enable-firebase-cloud-messaging-legacy-api.png" alt-text="Portal screenshot showing Enable Cloud Messaging API (Legacy).":::
94+
8595
## Configure a notification hub
8696

8797
1. Sign in to the [Azure portal](https://portal.azure.com/).
@@ -224,7 +234,7 @@ also have the connection strings that are necessary to send notifications to a d
224234
super.onCreate(savedInstanceState);
225235
setContentView(R.layout.activity_main);
226236
NotificationHub.setListener(new CustomNotificationListener());
227-
NotificationHub.start(this.getApplication(), "Hub Name", Connection-String);
237+
NotificationHub.start(this.getApplication(), "Hub Name", "Connection-String");
228238

229239
}
230240
```
222 KB
Loading

0 commit comments

Comments
 (0)