3

How i get WhatsApp abid to compose a message to a specific user ? i want to send a text message when i select a contact in my app.

This is my code:

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?abid=XXX"];
         if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
             [[UIApplication sharedApplication] openURL: whatsappURL];
         }

WhatsApp official link: https://www.whatsapp.com/faq/iphone/23559013

cassiomolin
  • 124,154
  • 35
  • 280
  • 359
Marcos
  • 31
  • 1
  • 2
  • Have u referred this one http://stackoverflow.com/a/17790720/5362916 – Uma Madhavi Feb 15 '16 at 09:44
  • ABRecordGetRecordID is deprecated in iOS 9... I'm using the new Contacts Framework and i can't find the equivalent for ABRecordGetRecordID. (identifier field is not the equivalent of ABRecordGetRecordID) – Marcos Feb 15 '16 at 10:50
  • 2
    It's not possible anymore, Whatsapp has removed the URL schema as I answered here: http://stackoverflow.com/questions/17711325/abid-in-whatsapp-url-schemes/36337907#36337907 – andreacipriani Mar 31 '16 at 15:42

1 Answers1

12

Two recent solutions (July 2017)

  1. WhatsApp 'Click to Chat' API feature must work on all devices:

    https://faq.whatsapp.com/en/general/26000030

  2. And, this other schema (for href links) seems to be working also:

    whatsapp://send?text=MESSAGE&phone=+NUMBER&abid=+NUMBER

DavidTaubmann
  • 3,223
  • 2
  • 34
  • 43