Reputation: 5896
I'm trying to open whatsapp conversation/chat for particular contact. Instead of opening the desired chat it only opens the app. No idea whats wrong :
let URLString = "whatsapp://send?abid=\(ID);text=lOL;"
UIApplication.sharedApplication().openURL(NSURL(string: URLString)!)
URLString value : whatsapp://send?abid=414;text=lOL
Any suggestions?
Upvotes: 1
Views: 2383
Reputation: 71854
Update your URL
like this:
whatsapp://send?abid=\(ID)&text=lOL
Source from HERE.
Upvotes: 3
Reputation: 6268
Try this and check if the UIApplication
and open the URL.
let whatsAppURL: NSURL = NSURL(string: "whatsapp://send?abid=\(ID)&text=lOL")
if UIApplication.sharedApplication().canOpenURL(whatsAppURL){
UIApplication.sharedApplication().openURL(whatsAppURL)
}
Upvotes: 1