Mattermost Logo
Edit on GitHub

Migrate GCM to FCM

As of April 10, 2018, Google has deprecated the Google Cloud Messaging (GCM) service. The GCM server and client APIs are deprecated and will be removed as of April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features.

The Mattermost Push Notification Service version 5.8+ uses FCM to send Push notifications for Android.

  1. Upgrade your Mattermost Push Notification service to version 5.8 or above
  2. Go to the Firebase Console and select the project you’ve created. Once in the dashboard, go to the project settings and select CLOUD MESSAGING. image image

  3. Look for the value of the Server Key and copy it. image

  4. Open the mattermost-push-proxy.json file in the mattermost-push-proxy/config directory and replace the value for the “AndroidApiKey” setting with the Server Key you just copied. image

  5. Restart your Mattermost Push Notification Service, and notifications should be sent using FCM.

    $ sudo service mattermost-push-proxy restart
    
  6. Test push notifications are being delivered as expected.

Troubleshooting 

Cannot send push notifications through FCM, connection refused or timeout. 

Make sure your firewall allows connections to the Firebase servers fcm.googleapis.com/fcm and fcm-xmpp.googleapis.com on ports:

80   TCP     HTTP client connection
443  TCP     HTTP client connection over SSL
5222 TCP     XMPP client connection  
5223 TCP     XMPP client connection over SSL