One approach on iOS is to store unique identifier in the “Keychain” (or iCloud itself) which is data kept in the cloud tied to a user’s Apple ID account. Of course this is only an impediment to a determined stalker (who could create a new Apple ID). But a determined stalker could also use a fake name and get a new phone number.
See https://stackoverflow.com/questions/25276393/how-to-ban-an-i... for more details.