0

I'm trying to make a internet radio app, that can open whatsapp. I know that you cant directly open whatsapp and direct the message to a specific contact, so I am now redirecting the whatsapp button to a link and it will open in safari. Now, I tried following tutorials, but it always says that the 'open url is deprecated'. Here is the code:

- (IBAction)btnWa:(id)sender {

    [[UIApplication sharedApplication] openURL:
     [NSURL URLWithString:@"https://api.whatsapp.com/send?phone=62------&text=&source=&data="]];
Timothy
  • 143
  • 3
  • 12
  • It doesn't just say it's deprecated: it also tells you that you should use openURL:options:completionHandler: – il3v Aug 23 '18 at 10:00

1 Answers1

2

Use Open Url with Completion Handler see this for more information: Link

Community
  • 1
  • 1
Sumeet.Jain
  • 1,533
  • 9
  • 26