How to open WhatsApp from Swift app?

前端 未结 5 1673
无人共我
无人共我 2021-02-03 15:51

I am using webview for my Swift app and I have \"Share on WhatsApp\" button on my website which works fine on a browser. But on iPhone app, when I click on the butt

5条回答
  •  猫巷女王i
    2021-02-03 16:05

    UIApplication.shared.openURL(URL(string:"https://api.whatsapp.com/send?phone=phoneNumber")!)
    

    phoneNumber might be with (+) or not.

    phoneNumber looks like 99455555555 or +99455555555

提交回复
热议问题