Self-host the Free SMS for WooCommerce relay

Don’t want to use the hosted relay, or want no 30-message limit? Run your own. The plugin and the Android app are open source, and both have a configurable service URL.

For developers. You will edit plugin and app source, build your own APK and run a small server. If that isn’t your thing, the hosted service costs $2/month and the first 30 messages each month are free.

Architecture

WooCommerce plugin --POST /sendMessage--> your relay --FCM data message--> Android app --> SMS

The relay maps a pairing token (qrToken, generated by the plugin and shown as a QR code) to the phone’s Firebase Cloud Messaging token, then forwards messages to that phone.

What your relay must implement

1. Register a phone

The Android app calls this when you scan the QR code:

POST /registerTokens
form fields: qrToken, firebaseToken

Store the mapping qrToken → firebaseToken and answer with HTTP 200. The app shows its success dialog on a 2xx response and an error dialog otherwise.

2. Send a message

The WooCommerce plugin calls this on each order status change (or test message):

POST /sendMessage
form fields: qrToken, phone (E.164, e.g. +4915112345678), message

Look up the Firebase token for qrToken and send an FCM data message to it containing the keys phone and message. The app reads exactly those two keys and sends the SMS.

Changes you make in the code

  1. Firebase project. Create one at the Firebase console and enable Cloud Messaging. Add an Android app with package name com.barpoltech.freesms (or your own after renaming) and download your google-services.json.
  2. Android app. Clone the app repo, put your google-services.json into the app/ module and set cloudFunctionURL in RegisterUtil.java to your service. Build and install your own APK with Android Studio or Gradle.
  3. WordPress plugin. In the plugin’s index.php replace the $SMSFWC_SEND_MESSAGE_URL variable with your /sendMessage URL. A plugin update overwrites that edit, so keep a fork or a small must-use plugin that re-applies it.

Things to get right

Links