Skip to main content

Android Application

WebSocket Version Guide
This functionality available only with WebSocket Version
Compatibility
This feature compatible with Better Messages 2.9.0 or higher

Android application feature allows you to generate native Android messenger application for your website, which allows you to send push and call notifications and can be published to the Google Play Market.

Requirements

  • Firebase Project

    To be able to generate and publish Android application, you need to have Firebase Project with enabled Firebase Cloud Messaging (FCM).

  • Play Market Developer Account (Production Only)

    To be able to publish Android application to the Google Play Market, you need to have Google Play Developer Account (25 USD one-time fee).

  • Android Device

    To be able to install and test an Android application, you need to have Android device.

Create Firebase Project

For building Android application, you need to create Firebase Project and enable Firebase Cloud Messaging (FCM) for it.

Follow these steps to create Firebase Project:

  1. Go to Firebase Console and login with your Google Account.

  2. Click on Create a Firebase Project button to create a new Firebase Project.

    Firebase Create Project

  3. Enter your project name (for example yourwebsite-messenger) and click on Continue button.

    Firebase Project Name

    Press continue until you reach the Project Overview page.

  4. Click on the Add app button and select Android.

    Firebase Add Android App

  5. Enter your Android package name (for example com.yourdomain.messenger), app nickname and SHA-1 certificate fingerprint are optional and not required to be filled and click on Register app button.

    Firebase Register Android App

    The Android package name must be unique and should follow the reverse domain name notation (e.g., com.yourdomain.messenger).

    For development and production applications, you can use the same package name, but it is recommended to use different package names for development and production applications to avoid conflicts.

    You can add one more Android package name for development purpose to the same Firebase Project or create a separated Firebase Project if you want to have a separate Firebase configuration for development and production applications.

  6. Download the google-services.json file and save it to your computer. You will need it later to configure the Android application build.

    Firebase Download Google Services JSON

  7. Click on Next button and then on Continue to console button to finish the Firebase Project creation.

  8. In the Firebase Console, go to Project SettingsCloud Messaging tab.

    Firebase Cloud Messaging Settings

  9. Ensure that Firebase Cloud Messaging API (V1) is enabled.

    If it is not enabled, click on the 3 dots menu and enable it in Google Cloud Console.

    Firebase Cloud Messaging API Enable

  10. Go to Project SettingsService accounts tab and click on the Generate new private key button to download the service account key.

    Firebase Service Account Key

    Save the downloaded JSON file to your computer, you will need it later to configure the Android application build in Better Messages settings.

Development & Production Builds

To generate Better Messages Android App Builds, it is required to configure for each type of build separately by uploading the google-services.json and Firebase Admin SDK Private Key files, which was downloaded from Firebase to WP Admin -> Better Messages -> Mobile App -> Settings -> Android page.

Android Settings

  1. Set application name
  2. Upload google-services.json file to Firebase SDK Configuration file field and select appropriate app id after upload.
  3. Upload Firebase Admin SDK Private Key file to Firebase Admin SDK File field.

After thats done it should look similar to this:

Android Settings Completed

The image above shows the configuration for the development build, the configuration for the production build configuration is the same.

To build the production build, you also need to Android Keystore file, which is used to sign the application before publishing it to the Google Play Market.

You can generate the Android Keystore file using Android Studio at the same page or upload the existing one if you already have it.

Android Keystore

After you have generated or uploaded the Android Keystore file, you will be able to build the production build of the Android application.

Development Build

Development build is used for testing purposes and can be installed only to Android devices or Emulators.

You can install the development build to your Android device or Emulator by scanning QR code with camera and downloading the APK file or by downloading the APK file directly by url.

Production Build

Production build is only possible to upload to Google Play Store with AAB file, for that you need to have Google Developer Account, which is required to publish the application to the Google Play Market.

You can register for a Google Developer Account here.