Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

whatsapp url scheme ios dev

In the new version whatsapp implemented url scheme like

NSURL *whatsAppURL = [NSURL URLWithString:@"Whatsapp://"];

if ([[UIApplication sharedApplication] canOpenURL:whatsAppURL]) {

    [[UIApplication sharedApplication] openURL:whatsAppURL];

}

anyone knows if there is any action related to that? like create a new message?

like image 561
Rodrigo Cavalcante Avatar asked Oct 15 '25 16:10

Rodrigo Cavalcante


2 Answers

With the new iPhone v2.10.1 release WhatsApp now publicly supports its own url scheme. E.g. to open a new chat composer with the text "Hello World" you have to do this:

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

More information can be found in this FAQ on their site: http://www.whatsapp.com/faq/en/iphone/23559013

like image 150
Klaas Avatar answered Oct 18 '25 11:10

Klaas


The whatsapp:// URL scheme has been registered by WhatsApp, according to this answer, and you may be able to launch the WhatsApp application.

Unfortunately, at date, there's no documentation available so it's not known whether there are useful actions associated with it.

like image 25
Gabriele Petronella Avatar answered Oct 18 '25 11:10

Gabriele Petronella