IMCAFS

Home

android two line code to check whether the mobile number is registered with whatsapp

Posted by fierce at 2020-03-21
all

Published on October 25, 2018 11:31:39

Call WhatsApp through Android scheme

Check whether the mobile phone number is registered in WhatsApp

Uri uri = Uri.parse("whatsapp://send?phone=8618800008888"); startActivity(new Intent(Intent.ACTION_VIEW,uri));

National area code is required for mobile phone number detection. 86 is China area code, followed by mobile phone number

The running program will call WhatsApp,

If this mobile number 8618800008888 has registered WhatsApp,

Will directly enter the chat page of this number,.

There are two states, one is directly entering the chat page, the other is that the mobile number is not registered.

The status can be used to capture whether this phone number has registered WhatsApp

We can get the phone number status through Android interface rendering, or through

Write a simple xposed module to get the status, or grab the package.

Scheme is just a simple way to judge,

There is a more efficient way, through the address book.

Subsequent updates.