How to set up custom Push notifications via Firebase Project for Android

Push notifications are sent to Virola client apps on mobile devices by the Virola server on events such as new messages or calls. Virola server uses APNS and Google GCM (FCM) services to send Push notifications.

Starting with version 2.8.1.26052216 you can set up a custom Push notifications option for Android on the Virola server. Using the Google Firebase, you can connect the Virola Android app and get Push notifications through your server. All you need is an active Google account, and the same versions of the Virola Server, Virola Client, and the Virola Android app.

Make a set up on the Firebase side

You need to create a Firebase project to connect to the Virola Android app with Firebase.

1. Create a Firebase project

Follow the Step 1"View instructions to create a Firebase project" on this page.

2. Register Virola Android app with Firebase project and Add a Firebase configuration file

  1. Open your created Firebase project
  2. Click on the "+ Add app""Android" icon
  3. Add the io.virola.virola_client in the Android package name field
  4. Make sure to enter the package name io.virola.virola_client without any changes. The package name value is case-sensitive, and it cannot be changed for this Firebase Android app after it's registered with your Firebase project.

    Screenshot of Firebase Project settings
  5. Click on "Register app" button
  6. Download a Firebase configuration file containing the data to be added to your Virola Client. Click on "Download google-services.json" button.
  7. Close the window with "x" on the top left

3. Generate the private key

  1. Click on the project name then Settings "gear" icon
  2. Follow Cloud Messaging tab
  3. In the Firebase Cloud Messaging API section click on the link "Manage Service Accounts"
  4. Click on the "three-dots" icon in Actions column → "Manage keys"
  5. Screenshot of Firebase Project settings
  6. After that click on "Add keys" button → "Create new key"
  7. Choose the Key type JSON → "Create"
  8. Save the project_name_key.json file with the current private key securely

After the private key is created, check if the key has "Active" status in the Status column.

Make a set up on the Virola client side

To connect your Firebase project with Virola server you need to log into Virola client as the server administrator and do the following:

  1. Follow AdministrationPush Notifications menu
  2. Choose the Advanced tab, check the box Use Custom Push Options for Android and complete the form
  3. Open the google-services.json file that was downloaded during the Firebase project registration.
  4. You will find the following data in this file:

    • project_id
    • client.client_info.mobilesdk_app_id
    • client.api_key.current_key

    Copy the data between quotes and paste in the specific field.

  5. Open the project_name_key.json file that you saved during the private key generation
  6. You will find the following data in this file:

    • private_key_id
    • private_key
    • client_email
    • token_uri

    Copy the data between quotes and paste in the specific field.

  7. Then click "Apply". You'll get the "Saved on Server" message