Two of our apps collect usage statistics only on devices outside the European Economic Area, the United Kingdom and Switzerland, so that no consent form is needed. On Android that is easy to check. On iPhone the SIM and network country cannot be read, so the same rule needed a different set of signals. This is how the rule is written once in Kotlin Multiplatform, and what it does when it is unsure. It describes our own design choice, not legal advice.
The rule in one sentence
Analytics is on only when we are sure the device is outside the restricted regions. If any signal points to a restricted country, it is off. If no signal is known at all, it is off. Being unsure always means off.
The rule lives in common code, so Android and iPhone cannot drift apart. It is a function that takes any number of country codes, some of which can be missing, and returns whether collection is allowed.
The shared function
The function trims each value, upper-cases it and keeps only two-letter codes.…