8

I've been asked to create a mobile application that checks the online status of selected whatsapp contacts, and notifies the user when the selected contact is online. I think this is possible, because it already exists another app that uses the same information and it works at least for someone:

https://play.google.com/store/apps/details?id=com.kiwiio.clonspy

However I have no clue about what kind of software interface I should query in order to obtain the whatsapp online status of a contact.

Is there any kind of WhatsApp API that I can use for that purpose? Android or IOs? Or both?

Lucio Crusca
  • 1,277
  • 3
  • 15
  • 41
  • Did you find solution to your problem? – Syed Ali Apr 25 '20 at 12:11
  • 1
    well, 5 years have come and passed after I accepted the answer below: I can only imagine that I somehow solved the problem back then, but I agree the accepted answer, as of today, doesn't seem to really answer my question. At that time it had to look clear to me, however today I woundn't be able to explain why anymore. Moreover 5 years are a lot of time in the mobile IT world, so that solution might well not apply anymore as of today. – Lucio Crusca Apr 26 '20 at 07:44

2 Answers2

5

According to this answer for iPhone developers on WhatsApp FAQ;

WhatsApp provides two ways for your iPhone app to interact with WhatsApp:

1-)Through a custom URL scheme

2-)Through the iOS Document Interaction API

If your application would like to open a WhatsApp Chat with a specific contact, you can use our custom URL scheme to do so. Opening whatsapp:// followed by one of the following parameters, will open WhatsApp and perform a custom action.

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
    [[UIApplication sharedApplication] openURL: whatsappURL];
}

On another answer for Android developers on WhatsApp FAQ, you can send a message via WhatsApp with an ACTION_SEND intent. You can also bypass the system picker, you can set sendIntent.setPackage("com.whatsapp"). For custom URL scheme:

WhatsApp provides a custom URL scheme to interact with WhatsApp:

If you have a website and want to open a WhatsApp chat with a pre-filled message, you can use our custom URL scheme to do so. Opening whatsapp://send?text= followed by the text to send, will open WhatsApp, allow the user to choose a contact, and pre-fill the input field with the specified text.

Here is an example of how to write this on your website:

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

There are two parameters at the time which are according to answer given for iPhone developers, which are app and send. Go to first link to find detailed information.

Also check WhatsAPI library by venomous0x.

Community
  • 1
  • 1
Mel
  • 1,730
  • 17
  • 33
  • 1
    You are absolutely right, I should have used google more efficiently. BTW, google also finds [this other library](https://github.com/tgalal/yowsup), which seems to be the best choice. – Lucio Crusca Feb 25 '15 at 09:56
  • Hope it helped you ^_^ I'll also check out that library since it might be more usefull to me too. Happy coding ! – Mel Feb 25 '15 at 10:02
-8

Airplane mode✈️. After receiving a text activate airplane mode read it close the app wait a couple of secs and deactivate it

  • 1
    Please give proper information where you stuck and which language you use or what kind of question please add more info. and mention tag so people can find you problem easily – l.b.vasoya Jun 26 '20 at 05:00
  • Your answer does not answer my question, or, if you think it does, you should add details explaining how it does. – Lucio Crusca Jun 26 '20 at 08:10
  • This doesn't answer the question at all. The question is NOT about how to block someone from seeing your online status. The question is about how to monitor if someone comes online and to let you know that the person is available. – GaidinD Jan 08 '22 at 09:35