Punit Sharma Punit Sharma - 1 year ago 148
iOS Question

Open Whatsapp on a particular number in swift

I am trying to open a particular contact chat in whatsapp but not getting any solution. Please help i am totally stuck. I have tried this:

let whatsAppURL: NSURL = NSURL(string: "whatsapp://send?abid=\(primary)&;text=lOL;")!
if UIApplication.sharedApplication().canOpenURL(whatsAppURL){

Answer Source

As per this whatsapp forum link, there is no way you can send message to specific user, this is not available within whatsapp URL scheme.

You just set predefined message and then with URL scheme you are able to open whatsapp recent controller.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download