5

I tried the following in a simple app and it no longer works:-

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:[NSString stringWithFormat:@"whatsapp://send?abid=%d&text=%@", abid, @""]]];

Has WhatsApp dropped this functionality in their latest version?

Andrew T.
  • 4,701
  • 8
  • 43
  • 62
Wael
  • 489
  • 6
  • 19
  • http://web.archive.org/web/20150329073451/https://www.whatsapp.com/faq/iphone/23559013 vs https://www.whatsapp.com/faq/iphone/23559013 `aide` parameter has disappeared (since it was related to AdresseBook.framework, and we should use Contacts.framework now maybe?) – Larme Jul 20 '16 at 12:16
  • Hi, thanks hmm interesting, I understand what you are saying, if this is the case, I am not sure what the parameter would be, I will try to investigate it further but until now I am looking for an answer. Thanks. – Wael Jul 21 '16 at 23:05
  • WhatsApp could have renamed abid into something else ! – Wael Jul 21 '16 at 23:06
  • You should use the new Offical API, I've mentioned it in here https://stackoverflow.com/a/45227158/1920145 – DavidTaubmann Jul 21 '17 at 01:02

2 Answers2

2

In iOS 9, LSApplicationQueriesSchemes need to call, ensure once are you added the following information in your .plist:

<key>LSApplicationQueriesSchemes</key>
 <array>
  <string>whatsapp</string>
 </array>

check this will work for you or not

PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
  • Thanks but this only allows to enable the ability to use the URL scheme for WhatsApp which is required however after that the problem is about passing the ABID parameter which used to work, if you pass the abid parameter with a valid contact id, it should open up the conversation for that specific contact ready for a new message but it seems that WhatsApp dropped the ABID parameter ! or renamed it !. Look carefully at my line of code above. Thanks – Wael Jul 24 '16 at 05:12
-1

Try using the following code for iOS 9:

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];

    if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
        [[UIApplication sharedApplication] openURL: whatsappURL];
    }