Mattermost Logo
Edit on GitHub

Android Push Notifications

Push notifications on Android are managed and dispatched using Firebase Cloud Messaging (FCM)

  • Create a Firebase project within the Firebase Console.

  • Click Add Project image

  • Enter the project name, project ID and Country

  • Click CREATE PROJECT

    image

Once the project is created you’ll be redirected to the Firebase project dashboard

image

  • Click Add Firebase to your Android App
  • Enter the package ID of your custom Mattermost app as the Android package name.
  • Enter an App nickname so you can identify it with ease
  • Click REGISTER APP
  • Once the app has been registered, download the google-services.json file which will be used later

  • Click CONTINUE and then FINISH image image image

Now that you have created the Firebase project and the app and downloaded the google-services.json file, you need to make some changes in the project.

  • Replace android/app/google-services.json with the one you downloaded earlier
  • Open android/app/google-services.json, find the project_number and copy the value
  • Open android/app/src/main/AndroidManifest.xml file, look for the line <meta-data android:name="com.wix.reactnativenotifications.gcmSenderId" android:value="184930218130\"/> and replace the value with the one that you copied in the previous step

Leave the trailing \ intact

At this point, you can build the Mattermost app for Android and setup the Mattermost Push Notification Service.