Skip to content

Commit 736e3e7

Browse files
authored
chore(push): Update fcm setup instructions (#7763)
1 parent 908b829 commit 736e3e7

File tree

8 files changed

+29
-33
lines changed

8 files changed

+29
-33
lines changed

src/fragments/lib-v1/push-notifications/android/getting_started/fcm-cli-resources.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Choose _FCM_ when promoted:
1616

1717
```
1818

19-
The CLI will prompt for your _Server Key_, paste the **Token** you copied while [setting up push notification services](/gen1/[platform]/prev/build-a-backend/push-notifications/set-up-push-service/).
19+
The CLI will prompt for your _service account key (json file) path_ created from steps in [setting up push notification services](/gen1/[platform]/prev/build-a-backend/push-notifications/set-up-push-service/). Enter the absolute path, or a path relative to the location where you ran the command.

src/fragments/lib-v1/push-notifications/android/setup_push_service/setup-fcm.mdx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ Push notifications for Android apps are sent using Firebase Cloud Messaging (FCM
66
- [Register your app with Firebase](https://firebase.google.com/docs/cloud-messaging/android/first-message#register_your_app_with_firebase)
77
- [Add a Firebase configuration file](https://firebase.google.com/docs/cloud-messaging/android/first-message#add_a_firebase_configuration_file)
88

9-
Next, you will need to access your **ServerKey** (Referred to as **ApiKey** in the CLI setup):
9+
Next, you will need to create your service account key (json file):
1010

1111
- Open the [Firebase console](https://console.firebase.google.com/).
1212
- Choose your Firebase project.
1313
- Select the gear icon located in the top left hand corner of your screen, then select **Project settings**.
1414

1515
![image](/images/push-notifications/setup-fcm/project-settings.png)
1616

17-
- Select the **Cloud Messaging** tab.
18-
- Select the three vertical dots next to **Cloud Messaging API (Legacy)**, then select **Manage API in Google Cloud Console**. ![The three dot menu button is circled in the cloud messaging tab.](/images/push-notifications/firebaseconsole.png)
19-
20-
![image](/images/push-notifications/setup-fcm/manage-api.png)
21-
22-
- In the new tab, select the **Enable** button.
23-
- Return to the previous page and refresh it.
24-
- Copy the **Server key** token
25-
26-
![image](/images/push-notifications/setup-fcm/server-id.png)
17+
- Select the **Service accounts** tab.
18+
- Select **Firebase Admin SDK** in the sidebar
19+
- Click **Generate new private key**
20+
- Keep the downloaded service account key (json file) safe. You will need to provide the path to the CLI.
2721

2822
Return to [Provisioning resources through CLI](/gen1/[platform]/prev/build-a-backend/push-notifications/set-up-push-notifications/#provisioning-resources-through-cli) with the copied **Token**

src/fragments/lib-v1/push-notifications/common/getting_started/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To use Push Notifications with Amplify, you have the option to either have the A
2626
2727
<Callout warning>
2828

29-
Push Notifications requires version **10.8.0+** of the Amplify CLI. You can check your current version with `amplify -version` and upgrade to the latest version with `amplify upgrade`.
29+
Push Notifications requires version **12.12.3+** of the Amplify CLI. You can check your current version with `amplify -version` and upgrade to the latest version with `amplify upgrade`.
3030

3131
</Callout>
3232

src/fragments/lib/push-notifications/android/getting_started/fcm-cli-resources.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Choose _FCM_ when promoted:
1616

1717
```
1818

19-
The CLI will prompt for your _Server Key_, paste the **Token** you copied while [setting up push notification services](/gen1/[platform]/build-a-backend/push-notifications/set-up-push-service/).
19+
The CLI will prompt for your _service account key (json file) path_ created from steps in [setting up push notification services](/gen1/[platform]/build-a-backend/push-notifications/set-up-push-service/). Enter the absolute path, or a path relative to the location where you ran the command.

src/fragments/lib/push-notifications/android/setup_push_service/setup-fcm.mdx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ Push notifications for Android apps are sent using Firebase Cloud Messaging (FCM
66
- [Register your app with Firebase](https://firebase.google.com/docs/cloud-messaging/android/first-message#register_your_app_with_firebase)
77
- [Add a Firebase configuration file](https://firebase.google.com/docs/cloud-messaging/android/first-message#add_a_firebase_configuration_file)
88

9-
Next, you will need to access your **ServerKey** (Referred to as **ApiKey** in the CLI setup):
9+
Next, you will need to create your service account key (json file):
1010

1111
- Open the [Firebase console](https://console.firebase.google.com/).
1212
- Choose your Firebase project.
1313
- Select the gear icon located in the top left hand corner of your screen, then select **Project settings**.
1414

1515
![image](/images/push-notifications/setup-fcm/project-settings.png)
1616

17-
- Select the **Cloud Messaging** tab.
18-
- Select the three vertical dots next to **Cloud Messaging API (Legacy)**, then select **Manage API in Google Cloud Console**. ![The three dot menu button is circled in the cloud messaging tab.](/images/push-notifications/firebaseconsole.png)
17+
- Select the **Service accounts** tab.
18+
- Select **Firebase Admin SDK** in the sidebar
19+
- Click **Generate new private key**
20+
- Keep the downloaded service account key (json file) safe. You will need to provide the path to the CLI.
1921

20-
![image](/images/push-notifications/setup-fcm/manage-api.png)
21-
22-
- In the new tab, select the **Enable** button.
23-
- Return to the previous page and refresh it.
24-
- Copy the **Server key** token
25-
26-
![image](/images/push-notifications/setup-fcm/server-id.png)
27-
28-
Return to [Provisioning resources through CLI](/gen1/[platform]/build-a-backend/push-notifications/set-up-push-notifications/#provisioning-resources-through-cli) with the copied **Token**
22+
Return to [Provisioning resources through CLI](/gen1/[platform]/build-a-backend/push-notifications/set-up-push-notifications/#provisioning-resources-through-cli) for instructions on providing the service account key (json file).

src/fragments/lib/push-notifications/common/getting_started/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To use Push Notifications with Amplify, you have the option to either have the A
3838
3939
<Callout warning>
4040

41-
Push Notifications requires version **10.8.0+** of the Amplify CLI. You can check your current version with `amplify -version` and upgrade to the latest version with `amplify upgrade`.
41+
Push Notifications requires version **12.12.3+** of the Amplify CLI. You can check your current version with `amplify -version` and upgrade to the latest version with `amplify upgrade`.
4242

4343
</Callout>
4444

src/fragments/sdk/push-notifications/android/getting-started.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Enable your users to receive mobile push messages sent from the Apple (APNs) and
66

77
1. Use the CLI to add storage to your cloud-enabled backend and app.
88

9+
<Callout warning>
10+
11+
Push Notifications requires version **12.12.3+** of the Amplify CLI. You can check your current version with `amplify -version` and upgrade to the latest version with `amplify upgrade`.
12+
13+
</Callout>
14+
915
In a terminal window, navigate to your project folder (the folder that typically contains your project level `build.gradle`), and add the SDK to your app.
1016

1117
```bash
@@ -21,7 +27,7 @@ Enable your users to receive mobile push messages sent from the Apple (APNs) and
2127
> FCM
2228
```
2329

24-
- Provide your `Server Key`. For information on getting an FCM `Server Key`, see the section [Setting Up FCM/GCM Guide](/gen1/[platform]/sdk/push-notifications/setup-push-service/). Use the steps in the next section to connect your app to your backend.
30+
- Provide your `service account key (json file) path` (relative or absolute). For information on getting an FCM `service account key`, see the section [Setting Up FCM/GCM Guide](/gen1/[platform]/sdk/push-notifications/setup-push-service/). Use the steps in the next section to connect your app to your backend.
2531

2632
## Connect to Your Backend
2733

src/fragments/sdk/push-notifications/android/setup-fcm.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ You can enable your Android app to receive push notifications that you send thro
88

99
1. In the Firebase console, choose *Download google-services.json*. Copy the downloaded `google-services.json` file to the `app` directory of your Android project.
1010

11-
To access the `Server Key`:
11+
To access the `service account key (json file)`:
1212
1. Open the [Firebase console](https://console.firebase.google.com/).
1313

14-
1. Choose your project.
14+
1. Select the gear icon located in the top left hand corner of your screen, then select **Project settings**.
1515

16-
1. Choose the settings icon next to *Project Overview* in the top left and then *Project Settings*.
16+
1. Select the **Service accounts** tab.
1717

18-
1. Open the *Cloud Messaging* tab.
18+
1. Select **Firebase Admin SDK** in the sidebar
1919

20-
1. Copy the token next to *Server key*.
20+
1. Click **Generate new private key**
21+
22+
1. Keep the downloaded service account key (json file) safe. You will need to provide the path to the CLI.

0 commit comments

Comments
 (0)