The only idea I have is to use a server. You transfer your contacts (the best anonymous ones) to the server, and there you can determine in which contact the application is also installed. The server returns the result.
Basically, all the contact list apps that I know use this approach (like whatsapp).
For hash functions of anonymity check.
source
share