GeoTech

Engineering / Case study

One contact number for every app and website, changed without a store update

GeoTech Engineering · · 7 min read

Mobile appsFlutterArchitectureConfiguration

In November 2026 we lost access to a WhatsApp number. It was the support number on several of our products, and it was typed by hand into about 180 pages of a marketing site, into mobile apps already installed on customers' phones, and into print files. Changing it in the code took an afternoon. Changing it on phones that already had the app was impossible until the next store release. This is how we made sure that cannot happen again: one field in an admin dashboard, one public endpoint, and apps that ask for the number instead of carrying it.

181pages that had the number typed in
187site files that now read it at load time
13codebases reading the shared number
0numbers built into the new app code

TL;DR

The problem: a number in 181 places

Our POS product ELKASHIER has a static marketing site generated from templates, a Flutter app for Android and iOS, a Windows build, and printed flyers. The support WhatsApp number was in all of them as a literal string. When the number stopped working, we had to find every copy. Two things made that harder than it sounds:

Why the usual fixes fall short

A constants file is the first instinct. It solves "181 places" in the source tree, but the value is still compiled into the binary. You have moved the problem, not removed it.

Remote config services solve the binary problem, but add a vendor SDK to every app and a console only developers open. The person who changes a support number is the business owner, and he already has an admin dashboard. It belongs there.

A hard-coded fallback ("fetch it, but if that fails use this one") feels safe and is exactly the trap we fell into. A fallback is a hard-coded number with extra steps. The day it is wrong, it is wrong on every phone that is offline or has not launched since.

The design

  1. One field. Each product's super-admin settings has a "support WhatsApp" field. Above that sits a shared "general settings" module in our internal projects dashboard, which holds the company-wide numbers for all products: one for Egypt, one for everywhere else.
  2. One public endpoint per product, for example /api/public/contact. It returns the number, a display form, and which region it chose. No personal data, no secrets.
  3. Resolution order, in one function on the server: the product's own field if filled; otherwise the shared number for the caller's country; otherwise nothing. Nothing is better than a guess.
  4. Every client reads it: the static site, the apps, and the build scripts for print.

Picking the country

We do not run a CDN in front of the dashboard, so there is no country header to rely on. The shared module looks the IP up in a local country database (DB-IP Lite, refreshed monthly by another of our services), with an older MaxMind file as a fallback. A signed-in user's phone number beats the IP: a +20 number gets the Egyptian line even when the user is travelling. If nothing is known, it defaults to Egypt, our main market.

// order: known phone → CDN country header (if one is ever added) → IP database → default
function pick({ phone, country, ip }) {
  const pr = phoneRegion(phone);
  if (pr) return { region: pr, by: 'phone' };
  const hc = norm(country);
  if (hc) return { region: hc === 'EG' ? 'egypt' : 'intl', by: 'header' };
  const ic = lookup(ip);
  if (ic) return { region: ic === 'EG' ? 'egypt' : 'intl', by: 'ip' };
  return { region: 'egypt', by: 'default' };
}

One consequence is easy to miss: the answer now depends on who asks. A shared cache in front of the endpoint would serve the Egyptian number to a visitor in Riyadh. The product endpoint is therefore marked Cache-Control: private, max-age=300, and products that call the shared module server-to-server pass their own visitor's IP, so the dashboard decides for the visitor, not for the product's server.

The static site

The generated pages still contain a number, because search engines and visitors without JavaScript should see one. But it is only the last build's copy. A small script on every page asks the endpoint and rewrites every tel: link, every wa.me link and every element marked data-contact:

fetch('/cloud/api/public/contact', { credentials: 'omit' })
  .then(r => r.ok ? r.json() : null)
  .then(c => {
    if (!c || !c.whatsapp) return;               // keep what the page has
    const d = String(c.whatsapp).replace(/\D/g, '');
    document.querySelectorAll('a[href^="tel:"]').forEach(a => a.href = 'tel:+' + d);
    document.querySelectorAll('a[href*="wa.me/"]').forEach(a =>
      a.href = a.href.replace(/wa\.me\/\d+/, 'wa.me/' + d));
  });

The site generator also reads the same endpoint, and it refuses to build if the admin field is empty. That turns "someone forgot to set the number" from a silent bug into a failed build.

The apps

This is the part that removes the store from the loop. In the Flutter app, the number comes from a tiny class that reads its cached copy from disk (fast, works offline) and then refreshes from the endpoint in the background:

static Future<void> load() async {
  final f = await _cacheFile();
  if (f != null && await f.exists()) _apply(jsonDecode(await f.readAsString()));
  unawaited(refresh());   // ask the server; on success, overwrite the cache
}

static String get phone => _phone;   // '' until the app has been online once
static bool get hasPhone => _phone.isNotEmpty;

There is deliberately no default. The About page and the printed receipt check hasPhone and leave the line out if the app has never been online. A till that connected once keeps the last number it saw. None ever shows a number we baked in months ago.

What we got wrong first

Our first fix after losing the number was the obvious one: replace the old literal with the new literal everywhere. It worked for the website the same day. But the apps already in the stores kept the dead number, and they still carry it until their next release ships. We had fixed the source and left the users. The contact class above came the next day, and the rule became: the number does not live in the code at all, including as a backup.

Result

Checklist

  1. Search your whole tree for the number, with a tool that does not skip ignored or generated folders.
  2. Put the number in the admin dashboard the business owner already uses. One field per product, one shared default above it.
  3. Expose it on a public endpoint with no personal data. If the answer depends on the visitor, mark it private.
  4. In apps: fetch on launch, cache the last answer, and ship no built-in fallback. Hide the line until you have a real value.
  5. On static sites: keep a copy in the HTML for crawlers, rewrite it at load time from the endpoint.
  6. Make the build fail when the field is empty.
  7. Pick by country if you have regional lines, with a known user's phone ahead of the IP.

Need this?

Every product GeoTech builds, from DentX and Krown to ELKASHIER and Curava, ships with its contact details, payment settings and keys managed from one admin dashboard, so the business owner changes them without a developer or a store release. If your apps carry numbers or links that you cannot change today, talk to GeoTech.