使用Abid打开WhatsApp对话不起作用

我正在尝试为特定联系人打开whatsapp对话/聊天。 它不会打开所需的聊天,而只会打开应用程序。 不知道什么是错的:

let URLString = "whatsapp://send?abid=\(ID);text=lOL;" UIApplication.sharedApplication().openURL(NSURL(string: URLString)!) 

URLString值: whatsapp://send?abid=414;text=lOL

有什么建议么?

像这样更新您的URL

 whatsapp://send?abid=\(ID)&text=lOL 

来自HERE 。

试试这个并检查UIApplication是否打开URL。

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