Configuring Push Notifications

Prev Next

When you white-label the mobile app, the default push notification gateway is unavailable. To enable push notifications for your custom app build, follow this guide to configure them manually. This ensures that your workspace users on mobile devices continue to receive push notifications.

Configuring gateway

  • Navigate to Administration > Workspace > Settings > Push on your workspace.

  • Disable Gateway.

  • Disable Production if you’re trying in debug mode.

Configuring Android

Generating FCM service account

  • Navigate to the Cloud Messaging tab on the Firebase project.

  • Under Firebase Cloud Messaging API, tap on Manage Service Accounts to be redirected to Google Cloud Console.

  • Go to Create Service Account, fill name and ID and click Create and Continue

  • On Grant this service account access to project, filter for a role called Firebase Cloud Messaging API Admin

  • Click Done and navigate to the Service Account you just created

  • Go to Keys > Add Key

    Service account > Keys

  • Select JSON and click Create

    Generate service account JSON

  • This JSON file is going to be used to send push notifications

Configuring FCM on Rocket.Chat

  • Navigate to Administration > Workspace > Settings > Push

  • Make sure Use legacy notification provider is turned off

  • On Certificates and Keys, copy the Service Account content you just created to Google FCM API Credentials

  • Save and restart your workspace.

  • Log into the server as the same user on your mobile device and close it (it won’t receive push notification if it’s open).

  • Navigate to Administration > Workspace > Settings > Push and click on the Send a test push to my user button.

Configuring iOS

  • Ensure you have done "Creating Push Notifications certificates”.

  • In your terminal, go to the folder which contains your push files (CSR, .cer, .p12).

Generating PEM files (Development)

To generate PEM files for a development environment,

  • Run the following commands:

openssl x509 -in aps_development.cer -inform der -out DevPushCert.pem
openssl pkcs12 -nocerts -out DevPushKey.pem -in yourP12File.p12
  • You must set a password for your PEM file.

Generating PEM files (Production)

To generate PEM files for a production environment,

  • Run the following commands::

openssl x509 -in aps.cer -inform der -out PushCert.pem
openssl pkcs12 -nocerts -out PushKey.pem -in yourP12File.p12
  • You must set a password for your PEM file.

Copying PEM files to Rocket.Chat

  • Copy the contents of your development PEM files and password into APN Dev Key, APN Dev Cert, and APN Dev Passphrase on your Push > Certificates and Keys workspace settings.

  • Copy the contents of your production PEM files and password into APN Key, APN Cert, and APN Passphrase on your Push > Certificates and Keys .

  • Get the content of your PEM files using cat by running this command:

cat PushKey.pem
  • Save and restart your workspace.

  • Log in to the server as the same user on your mobile device and close it (it won’t receive push notifications if it’s open).

  • Navigate to Administration > Workspace > Settings > Push and click on the Send a test push to my user button.

Notification workflow

Page embed from Whimsical: Notification workflow

You can find more information on push notifications configuration in our admin guide.