Alerts without Firebase: SMS with a budget
How RentPin reaches a closed app with capped text messages instead of push notifications.
A RentPin caretaker needs to know the moment a renter asks to view a home, even when the caretaker’s app is closed. The usual answer is push notifications through Firebase. RentPin does not use Firebase, so there is no push notification to a closed app. Three smaller mechanisms do the job instead.
What replaced push
Reminders are scheduled on the phone. A reminder a day and an hour before a viewing is set on the renter’s own device. It needs only the notification permission, and no server has to remember to send it.
While the app is open, it asks. The phone checks for replies every 30 seconds and shows a small notice. The unread count sits on the message icon.
When the app is closed, a text message. The important alerts go out by SMS through a provider wired in app/sms.py.
Who gets texted, and about what
A caretaker is texted for a new viewing request, a viewing moved that needs a new yes, a guest arriving at the gate, a renter writing to them, and their building going live. A renter is texted when their viewing is confirmed (with the fee) and, only if they chose “Text me when they reply”, when a caretaker replies. A caretaker’s alert switches apply to texts too. “Building is live” is always sent.
A text costs money, so it has a budget
The cost limits are written into the code, not left to good intentions:
- Each kind of alert has a cooldown. For messages, that is one text per conversation per hour for caretakers and per 30 minutes for renters.
- No number receives more than 12 alert texts in a day. The cap is a constant,
DAILY_CAP, inapp/sms_alerts.py. - When WhatsApp is configured it already announces new requests, so the new-request text is skipped to avoid paying twice.
What it deliberately does not do
A renter’s optional number for reply texts is stored only for that purpose. It is never shown to the caretaker, to admins, or in any API response. Texts are in English for now. If sending fails, the failure is logged and the booking or message still goes through: an alert is never allowed to block the thing it is announcing.
What stays switched off
The code for Expo push notifications is still in the repository, but it does nothing without credentials. Supplying an access token and a project id would switch it on later, so choosing SMS now did not close the door on push.
The point
A channel that costs money per message needs its limits in code, where they are tested and visible, not in a spreadsheet someone checks at the end of the month.
Written from the operations notes of RentPin, which is pre-launch. The limits below are design settings, not measured delivery rates.