Punit Sharma Punit Sharma - 24 days ago 24
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){
UIApplication.sharedApplication().openURL(whatsAppURL)
}

Answer

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.

Comments