If you give every resident a nice check every month (the universal basic income) and have open borders, your country will soon be overcrowded with immigrants. And if you give the universal basic income to citizens only,
it it not universal any more.
There is an easy compromise that does not require means testing:
*Citizens-by-birth (regardless of whether it is acquired territorially or by blood-line) are eligible past majority age, as long as they reside in the country (short interruptions up to a year may be considered acceptable for this purpose)
*Naturalised people and immigrant residents become eligible past residency of equal length to majority age, subject to the rule above