withFallback

Builds a detector that tries the receiver first and falls back to fallback when it yields nothing.

The idiomatic way to add a backend IP lookup without giving up the device signals:

val detector = CountryDetector { api.geoCountry()?.let { detected(it, Network) } ?: Unavailable }
.withFallback(DefaultCountryDetector(context))