0

I am working on the IOS Application to send whatsapp calls from my application. I tried for the source to make calls but I got nothing. Can any one please suggest me some good source on making whatsapp Voice calls.

But I known that whatsapp not released api to make calls from other apps in IOS.

Cœur
  • 37,241
  • 25
  • 195
  • 267
basha
  • 587
  • 2
  • 6
  • 25

1 Answers1

1

You can not directly make WhatsApp call from your app. You can redirect to particular contact chat thread using below code:

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?phone=+91ContactNumberHere"];

if ([[UIApplication sharedApplication]canOpenURL:whatsappURL]) {
[[UIApplication sharedApplication]openURL:whatsappURL options:@{} completionHandler:nil];
} else {

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error" message:@"Whatsapp is not installed on your device." preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleCancel handler:nil];
    [alert addAction:okAction];
    [self presentViewController:alert animated:true completion:nil];
}
iVarun
  • 6,496
  • 2
  • 26
  • 34