The Problem
Sending and receiving SMS messages without relying on third-party services can be a hassle. You often end up paying through the nose for virtual numbers or navigating clunky APIs. If you're in a region where such services are limited or non-existent, you're left scrambling for a solution. Enter httpSMS, which turns your Android phone into a programmable SMS gateway using a simple HTTP API.
What This Does
httpSMS uses a combination of Go for the backend and Kotlin for the Android app. You can find the API code in the api/ directory, with the entry point at api/main.go. This is where the magic happens. The Android app, located in the android/ folder, communicates with the API to send and receive SMS messages. The Docker setup is outlined in api/Dockerfile, which simplifies deployment, especially if you're not keen on wrestling with environment configurations.
The API exposes methods to send messages, manage incoming SMS, and more. For instance, check out api/cmd/fcm/main.go, which handles Firebase Cloud Messaging integration for notifications. There’s also a README.md that gives a solid overview of setup and usage.
Real-World Use
Imagine you need to send out bulk SMS notifications for an event. With httpSMS, you can spin up the service on your own hardware or a cloud instance, configure it through api/go.mod, and start sending messages via a simple HTTP request. Here’s a quick code snippet:
This sends a reminder without the overhead of external SMS services. Plus, incoming messages can be set to forward to your webhook directly.
The Bottom Line
httpSMS is a solid solution if you want control over your SMS without the usual hurdles. It’s not for everyone—if you’re looking for something lightweight, this might feel like overkill. However, if you're in a tight spot or need a reliable SMS solution and have an Android phone at your disposal, give it a shot. Just be ready to dive into some Docker and Go if you want to get the most out of it.