Configuring FCM for Android

Firebase Cloud Messaging (FCM) enables Avalanche’s smart device server to establish communication with your Android devices. To enable FCM support on the smart device server, you must obtain credentials from Google to authenticate your server. This process involves creating a Firebase project, adding an Avalanche app to your project, obtaining FCM credentials, and providing Avalanche with your FCM credentials. To complete this process, you must have a Google account.

Avalanche currently has two apps that can use FCM for communication: the standard Avalanche Enabler and the Android Enterprise Enabler. Both apps can be supported in one Firebase project.

If you previously used GCM with Avalanche and want to migrate to FCM, see Google's Migration Guide.

FCM only works with 6.3 enablers and newer.

FCM ports

FCM requires the following ports to be open on your network: 5228, 5229, and 5230. We recommend whitelisting these ports with no IP restrictions. If your organization must restrict connections, see the Firebase article FCM ports and your firewall for more information.

Setting up FCM

To create a Firebase project for Avalanche

1.In a web browser, navigate to https://console.firebase.google.com.

2.Click Add project.

3.Enter AvalancheFCM as the project name.

4.(Optional) Set up Google Analytics for your project.

5.Click Create project.

To add an Avalanche app to your Firebase project

1.In your AvalancheFCM Firebase project, navigate to Project Settings.

2.On the General tab, select the option to add an Android app to Your apps.

3.If you are using the standard Avalanche Enabler, enter com.wavelink.android as the package name.
-OR-
If you are using the Android Enterprise Enabler, enter com.ivanti.enterprise as the package name.

4.Click Register app.

5.Download the google-services.json and click Next.

6.Click Continue to console.

To obtain FCM credentials

1.In your AvalancheFCM Firebase project, navigate to Project Settings.

2.On the Service accounts tab, click Generate new private key.

3.Click Generate key.
The service accounts private key downloads.

To provide Avalanche with FCM credentials

1.In the Avalanche Console, navigate to the Profiles tab.

2.Click the name of the smart device server profile you want to edit.

3.Click Edit.

4.In the Google Firebase Cloud Messaging section, click Add next to Google-Services File.

5.Open the google-services.json file that was downloaded when you added the Avalanche app to your Firebase project.

6.Click Add next to Service Account File.

7.Open your service accounts private key JSON file.

8.Click Save at the top of the profile.

9.Run a deployment.

Your Android devices can now use Google Cloud services for communication with Avalanche. You must also have an SSL certificate for the smart device server in order to connect smart devices. For more information about certificates, see Obtaining SSL Certificates.

If the smart device server log produces 403 errors, you may need to enable the Firebase Cloud Messaging API at https://console.developers.google.com/apis/library/fcm.googleapis.com.