Punit Sharma Punit Sharma - 5 months ago 69
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){


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.