| title | include file |
|---|---|
| description | include file |
| services | notification-hubs |
| author | sethmanheim |
| ms.service | azure-notification-hubs |
| ms.topic | include |
| ms.date | 09/11/2019 |
| ms.author | sethm |
| ms.custom | include file |
-
Sign in to the Firebase console. Create a new Firebase project if you don't already have one.
-
After you create your project, select Add Firebase to your Android app.
-
On the Add Firebase to your Android app page, take the following steps:
-
Select Download google-services.json, save the file into the app folder of your project, and then select Next.
-
Make the following configuration changes to your project in Android Studio.
-
In your project-level build.gradle file (<project>/build.gradle), add the following statement to the dependencies section.
classpath 'com.google.gms:google-services:4.0.1' -
In your app-level build.gradle file (<project>/<app-module>/build.gradle), add the following statements to the dependencies section.
implementation 'com.google.firebase:firebase-core:16.0.8' implementation 'com.google.firebase:firebase-messaging:17.3.4' -
Add the following line to the end of the app-level build.gradle file after the dependencies section.
apply plugin: 'com.google.gms.google-services' -
Select Sync now on the toolbar.
-
-
Select Next.
-
Select Skip this step.
-
In the Firebase console, select the cog for your project. Then select Project Settings.
-
If you haven't downloaded the google-services.json file into the app folder of your Android Studio project, you can do so on this page.
-
Switch to the Cloud Messaging tab at the top.
-
Copy and save the Server key for later use. You use this value to configure your hub.
-
If you do not see a Server key on the firebase Cloud Messaging tab, follow these additional steps.
- Click on the three-dots menu of the "Cloud Messaging API (Legacy) 🚫 Disabled" Heading
- Follow the offered link to "Manage API in Google Cloud Console".
- In google cloud console, press the button to enable the googlecloudmessaging API.
- Wait a few minutes.
- Go back to your firebase console project Cloud Messaging tab, and refresh the page.
- See that the Cloud Messaging API header has changed to "Cloud Messaging API (Legacy) ✅ Enabled" and now shows a Server Key.






