Skip to main content

Native Android Messenger App for WordPress

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.

Calls in the app run in native call screens, with device settings, Host Controls for moderators and the rest described in Calls in the mobile app.

Branded Android messenger app generated with Better Messages

The Overview tab#

Better Messages → Mobile App → Overview checks everything below for you, so you can see what a build still needs before starting one rather than reading it out of a failure.

Each row reads Ready or Missing, and its label links straight to the field that sets it. The Login logo row reads Optional instead of Missing, since no build needs it. A missing row explains what it is for rather than only naming the gap.

The tab is grouped as:

  • App version — which app revision the build server is on, and whether each platform and build type is carrying it. A plugin update reaches the installed app on its own. A change to the app itself does not, so a row here reading Carries an older app means you need to build again and reinstall it on your test devices, or submit it to the store.
  • Before you build — what every build reads, whichever platform it is for: application icon, splash screen and splash screen background, and the login logo, which is optional and recommended. Without a login logo, the login screen shows the site icon or the site name.
  • Android — notification icon, app names, the development and production Firebase projects, and the signing keystore. All of them are covered below.
  • iOS — the same for the iOS app.
  • Builds — a shortcut to start one.

A build is ready to start when every row for the platform and type you are building reads Ready.

Mobile App overview tab showing readiness checks for iOS and Android
note

The build server keeps a build's files for 90 days and then deletes them — download or submit them within that time.

How an update reaches an installed app#

There are two separate paths, and only one of them goes through Google Play.

Plugin updates arrive on their own. The app carries the site's scripts, styles and settings rather than baking them in, so updating Better Messages on the site updates every installed copy. What the member sees depends on what changed:

What the update changedWhat the app does
Settings onlyApplied live, in place. No prompt, no restart
StylesheetsSwapped in immediately. No prompt
Application codeA notice reads "A new version of the application has been downloaded." with an Update now action that restarts the app into it

Dismissing that notice costs nothing — the downloaded version is already stored, and it starts being used at the next launch whether the member tapped Update now or not.

App updates need the store. Anything built into the shell itself — the icon, the splash screen, the Firebase configuration, a Capacitor plugin, a native call or push change — only reaches members through a new build that you publish. Once per launch the app asks Google Play whether a newer build of itself is live. If one is, a notice reads "A new version of the app is available in Google Play." with an Update action that opens the store page. Dismissing it snoozes that particular version for 24 hours.

This is the same split the Overview tab's App version rows describe: a row reading Carries an older app means the published copy is behind, and no amount of updating the plugin will fix it.

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 or Emulator#

    A development build installs on an Android phone or on an emulator, so an emulator is enough for testing. Use an emulator system image marked Google Play, because push notifications and the ringing of incoming calls need Google Play services. Before you publish, check the app on a real Android phone too, to see an incoming call on a locked screen the way your members will see it.

App branding#

Better Messages → Mobile App → General holds the assets every build is made with, whichever platform it is for. These are the Before you build rows on the Overview tab.

Application#

FieldRequirement
Application iconPNG, exactly 1024×1024, no transparency and no rounded corners — the platforms round it themselves
Splash screenPNG, exactly 2732×2732. It is cropped to each screen, so keep the artwork in the middle
Splash screen backgroundFills what the crop leaves over on a screen of a different shape, so it has to match the image background exactly. A build needs it set even when the artwork fills the screen
The Application section on the Mobile App General tab, with the icon, splash screen and splash screen background

Login screen#

The first screen the app shows anyone who is not signed in.

FieldRequirement
LogoOptional, and recommended. PNG or SVG with a transparent background. Without one, the login screen shows the site icon or the site name
Logo for dark modeOptional. Shown in place of the logo while the app is dark
Logo heightThe tallest the logo is drawn on the login screen
BackgroundPlain, or Soft glow with its color, strength, spread and position
Terms & Conditions URLLinked under the login form
Sign-in methodsWebsite and password, Website only or Password only

The section also holds Sign out on password change. See Login screen and Sign-in and two-factor authentication.

The General tab of the Mobile App page with the phone preview of the login screen

Android#

FieldRequirement
Notification iconPNG, exactly 96×96. Android draws it as a mask, so it must be white on transparent — anything else comes out a solid block

This one is required by every Android build.

The Android section on the Mobile App General tab, with the notification icon

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 Settings → Cloud 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 Settings → Service 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#

WP Admin → Better Messages → Mobile App → Android configures the two build types separately, with the files you downloaded from Firebase. Both sections carry the same four fields:

FieldWhat goes in it
App nameThe name the built app carries
google-services.jsonThe file downloaded from the Firebase console for this project
PackageThe application id the app is built as. The list is read from the uploaded google-services.json, so upload that first
Firebase Admin SDK keyThe service-account private key. Push notifications are sent with it

Development#

Android development build settings in Better Messages

Production#

The same four fields, filled from the production Firebase project.

Android production build settings in Better Messages

Signing keystore#

A production build also needs an Android keystore, which signs the app before it goes to Google Play. Better Messages can generate one for you — you do not need Android Studio — or you can upload an existing one.

Android signing keystore in Better Messages

Pressing Generate asks for two groups of values:

Credentials Information

FieldNotes
KeyStore PasswordLeave empty to generate one automatically
Key AliasThe name the key is stored under
Key PasswordLeave empty to generate one automatically

Certificate Information — First and Last Name, Organization, Organization Unit, City, State, and Country Code (XX). These are baked into the certificate and are not shown to users.

The Generate a keystore dialog, with credentials and certificate fields
Keep a copy of the keystore

An app on Google Play can only ever be updated with the key it was first signed with. Lose the keystore and you cannot ship an update to that listing — you would have to publish a new one under a new package name. Use Download to keep a copy somewhere safe, along with the passwords.

Since 3.2, links on your site open the app, and website sign-in returns to the app with no confirmation, once Android has verified that the site and the app belong together. The site serves the file Android checks, /.well-known/assetlinks.json, by itself, with the package of each build type and the fingerprints in the App links section of the Android tab:

FieldWhat goes in it
Upload key SHA-256Filled in by itself from the signing keystore above
Play App Signing SHA-256For an app on Google Play: in the Play Console, Test and release → App integrity → App signing, copy the SHA-256 certificate fingerprint of the app signing key. Google signs the app it delivers with that key, so Android checks the app against it
The App links section of the Android tab, with the Upload key SHA-256 and the Play App Signing SHA-256 field marked

See Links that open the app for the addresses and how to check the file.

Creating a build#

Once the settings are in place, go to the Builds tab and press New build. The flow asks two questions:

  1. Platform — the store the build is made for: iOS or Android.

    Choosing the platform for a new build
  2. Build type — Development installs on a device or emulator directly, Production produces the AAB you upload to Google Play.

    Choosing the build type for a new build
  3. Better Messages then shows a Create New Build summary of what the build will be made with — site ID, platform, domain, API URL, type, app name, icon and package name — so you can read it back before starting. Press Create Build to send it to the build server.

    The Create New Build summary for an Android development build

A Production build adds two more values to that summary, and you can change either from there before starting:

FieldWhat it is
VersionThe version people see on Google Play, like 1.0 or 1.0.1
Build NumberA whole number, higher than the last one uploaded to Google Play
The Create New Build summary for an Android production build, including Version and Build Number

If anything required is still missing, this screen says so instead of showing the summary, and the build cannot be started until you fix it.

Development Build#

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

QR code to install the Android development APK on a device or emulator

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.

Android production AAB ready to upload to Google Play Store

Incoming calls on a locked phone#

From Android 14, an incoming call can only take over a locked screen when the app is allowed full-screen notifications. Google Play turns them on at install only for apps that declare calling as a core function, so complete that declaration before you publish: in Play Console open Monitor and improve → App content and fill in the Full-screen intent declaration, saying that the app is used to receive calls. Without it, a call on a locked phone rings with nothing on the screen to answer it from.

The app checks this too. From Better Messages 3.0.9, when full-screen notifications are off, the Android app asks the member to allow them — once after the notification prompt, again after a call they missed on a locked phone, and in the app's Settings for as long as they stay off — with a button that opens the page in Android Settings where they are turned on. An app built before 3.0.9 needs a new build to get this.

Foreground service permissions#

From Better Messages 3.0, the Android app keeps a call running when the member leaves the app, locks the phone or shares the screen. Android allows that only from a foreground service, and the app declares four types of it: phone call, microphone, camera and media projection. All four belong to audio calls, video calls and screen sharing. Every app Better Messages builds carries them, so Google Play asks for a declaration of each one before it accepts a release.

In Play Console open Monitor and improve → App content, the same page as the Full-screen intent declaration above, and fill in Foreground service permissions. For each type Google asks for a description of the feature that uses it, what happens for the member when the system delays or stops it, and a link to a video that shows the steps in the app that start it. Google prefers a YouTube link, and the video can be unlisted.

To record the videos you need your app on an Android phone, a second account signed in on another device, and calls switched on in WP Admin → Better Messages → Settings → Calls. The screen recorder in the Quick Settings of Android records the phone screen.

Phone call — FOREGROUND_SERVICE_PHONE_CALL

  • Description: keeps an audio or video call running when the member leaves the app or locks the phone, and shows the ongoing call notification with a Hang up button. It also lets a member answer an incoming call on a locked phone.
  • If delayed or stopped: the call drops for both people as soon as the member leaves the app or the screen turns off, and a call answered on a locked phone cannot start.
  • Video: start an audio call to the second account and answer it. Press Home, pull down the notifications to show the ongoing call, lock the phone for a few seconds while still talking, then unlock, return to the call and hang up.

Microphone — FOREGROUND_SERVICE_MICROPHONE

  • Description: keeps the microphone of the member on during a call when the member switches to another app or the screen turns off.
  • If delayed or stopped: the other person stops hearing the member while the call still looks connected.
  • Video: during a call, open another app and keep talking while the second device shows the call is still live.

Camera — FOREGROUND_SERVICE_CAMERA

  • Description: keeps the camera of the member sending video during a video call when the call shrinks into the small floating window and the member uses another app.
  • If delayed or stopped: the video of the member freezes for the other person.
  • Video: start a video call, press Home so the call moves into the floating window, open another app and show the camera picture still moving in the window and on the second device.

Media projection — FOREGROUND_SERVICE_MEDIA_PROJECTION

  • Description: shares the screen of the member with the other people in a call. It runs only while the member is sharing, after the member starts it and confirms the Android prompt.
  • If delayed or stopped: Android does not let the app share the screen at all, so the share does not start or stops for everyone watching.
  • Video: during a call, tap the screen sharing button, confirm the Android prompt, switch to another app and show the second device seeing the shared screen, then stop sharing.

Store screenshots#

Better Messages → Mobile App → Screenshots generates the screenshots for your Google Play listing, at the exact pixel sizes Google accepts, without you having to run the app and capture them by hand.

Beta — added in 3.0

Screenshot generation is new. The files are the right size and format, but check each one before you upload it — a screen the generator renders badly is still a screen a reviewer sees.

What to show — pick from Inbox, Conversation and Group chat. Each screen becomes one screenshot per device size, and they appear on the listing in the order shown here. Each carries a caption drawn on the framed version, which you can edit or clear.

Sizes — Google Play rejects a file that is not one of its exact sizes, so each is written at the size named:

SizePixels
Android phone1080 × 1920
Android 7" tablet1200 × 1920
Android 10" tablet1200 × 1920
Feature graphic1024 × 500

Google Play takes 2 to 8 screenshots per size — note the lower bound, since one screenshot per size is rejected. The feature graphic is the banner across the top of the listing, not a screenshot of the app.

Framing — under Versions you can generate a plain capture, a framed version, or both. A plain capture is what the app really looks like. A framed one reads better at the size a store page shows it. The framed version has three settings of its own:

SettingWhat it does
BackgroundTwo colours. Set both to the same value for a flat background, or different ones for a gradient
Caption colourThe colour the caption is drawn in
Device outlineDraws a generic rounded bezel around the screen
The Screenshots tab, with the screens to show, the store sizes and the framing options
Keep the tab in front while it runs

Generating starts the messenger off-screen and photographs it at each size, in the browser tab you started it from. Navigating away before it finishes cancels the run — and switching to another tab stalls it, because browsers stop painting a background tab and each shot needs a frame to be drawn. Leave the Screenshots tab in the foreground until the count reaches the end.

The shots are held in the page, not on the server: the Download buttons appear only in the result list after a run, and reloading the tab discards them. Download the ZIP before you navigate away, or you will have to generate again.

Devices#

Better Messages → Mobile App → Devices lists every device that has registered with your site from the app — searchable and paginated.

ColumnWhat it shows
UserThe WordPress user signed in on that device
DeviceModel and OS, marked Simulator where applicable
ApplicationWhich build it is running — hover for the application identifier
NotificationsSubscribed or Not Subscribed for push
Last ActiveWhen the app last checked in
ActionsSign out signs that device out of the app (since 3.2)

Under the application, App revision tells which revision of the app the device runs. See Signed-in devices.

The Devices tab listing the devices of a member with their app revision and a Sign out button

It is the quickest way to answer "why is this user not getting push notifications" — a device showing Not Subscribed never registered for them.